Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
How to apply a validation rule for control in WPF-MVVM
jeevan mummadi
Mar 23 2013 1:18 PM
1.6k
Reply
Hi All,
Currently I am working on WPF with MVVM patern. I created one sample apps like this
View
------
<TextBox Grid.Row="0" Grid.Column="1" Width="100" HorizontalAlignment="Center" Text="{Binding Student.Name, Mode=TwoWay}"/>
ViewModel
--------------
public Student Student
{
get
{
return _student;
}
set
{
_student = value;
NotifyPropertyChanged("Student");
}
}
Model
--------
public class Student
{
public string Name { get; set; }
}
Can you please any one explain about how to validate a property for example "Name"
We have to apply validation rule in ViewModel or Model level.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Sorting issue in wpf grid
WPF MediaElement and Subtitle