Validation in silverlight through prism

Topics: Prism v4 - Silverlight 4
Feb 1, 2013 at 5:51 AM
Hi to all friends out there.
I am not able to get validation with prism for silverlight 5 Application.For validation i am implementing INotifyDataErrorInfo interface in my viewmodel and this is my texbox xaml which i am validating.

<TextBox Grid.Column="1" HorizontalAlignment="Left" Height="21" Margin="2,2,0,0" TextWrapping="Wrap" VerticalAlignment="Center" Width="150" Background="#FFFBF7F7" Text="{Binding Path=Username,Mode=TwoWay,NotifyOnValidationError=True}"/>

I am getting the red tooltip but only getting first letter and if possible please show me one piece of sample so that i can know where i am going wrong in validating the data.

Thanks in advance.
Feb 1, 2013 at 4:52 PM

As a starting point, I believe you could try setting the ValidatesOnException property of the binding to True and check if the behavior you are mentioning keeps happening.

Regarding about how to use the INotifyDataErrorInfo interface, you can find some useful information in the following section on the Prism documentation:
Also, you might find the MVVM Quickstart provided by Prism useful, as it portrays the use of the INotifyDataErrorInfo interface to notify about errors in its questionnaire fields.


Damian Cherubini