Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF C#4.0 VS2010 .NET4
HI, sorry for my english.
I have a problem with WPF, and so have the application, where it wants to implement validation controls. I created a class StringValidation that inherits from the ValidationRule. There, I implemented the method validation. in XAML while I did something like this:
<TextBox Height="23" Margin="53,39,0,0" Name="txtNazwa" VerticalAlignment="Top" TabIndex="3" MaxLines="1" GotFocus="txtNazwa_GotFocus" HorizontalAlignment="Left" Width="218"
                             ToolTip="Nazwa wybranej roli" Style="{StaticResource textBoxError}" Validation.ErrorTemplate="{StaticResource errorTemplate}">
            <TextBox.Text>
                    <Binding Path="Nazwa" UpdateSourceTrigger="PropertyChanged" >
                        <Binding.ValidationRules>
                            <s:StringValidation ValidatesOnTargetUpdated="True"
                                                                    ValidationStep="RawProposedValue"
                                                                    ErrorMessage="Error"
                                                                    TylkoNiePuste="True"
                                                                    />
                        </Binding.ValidationRules>
                    </Binding>
            </TextBox.Text>
</TextBox>
 
And everything started working, so I think that is ok, whereas in the designer crashes error:
 
Error 1 The type 's:StringValidation' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
where I added:
 
xmlns:s="clr-namespace:MOJA.Kontrolka.Admin"
 
where the namespace is consistent with the StringValidation class. I do not know what it is, a very difficult job to me. Any suggestions where is the problem and how to fix / avoid?
Posted 8-Jan-13 21:43pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 335
1 OriginalGriff 250
2 DamithSL 170
3 Kornfeld Eliyahu Peter 130
4 Peter Leow 95
0 OriginalGriff 7,315
1 DamithSL 5,199
2 Sergey Alexandrovich Kryukov 4,917
3 Maciej Los 4,866
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100