This is for validation, ViewModel code: using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using GalaSoft.MvvmLight; using System.ComponentModel; using System.Collections.Generic; namespace MvvmLightTest.ViewModel { public class CustomerViewModel : ViewModelBase, INotifyDataErrorInfo { private readonly Dictionary<string, List<string>> customerErrors = new Dictionary<string, List<string>>(); private string _name; public string Name { get { return _name; } set { var nameErrors = new List<string>(); bool raiseErrorEvent = false; if (string.IsNullOrEmpty(value)) return; if (value.Length != 2) { const string info = "Name must has 2 letters."; nameErrors.Add(info); if (!customerErrors.ContainsKey("Name")) customerErrors.Add("Name", nameErrors); raiseErrorEvent = true; } else { if (customerErrors.ContainsKey("Name")) { customerErrors.Remove("Name"); raiseErrorEvent = true; } _name = value; RaisePropertyChanged("Name"); } if (raiseErrorEvent && ErrorsChanged != null) ErrorsChanged(this, new DataErrorsChangedEventArgs("Name")); } } private int _age; public int Age { get { return _age; } set { var ageErrors = new List<string>(); bool raiseErrorEvent = false; if (value<0 || value>100) { const string info = "Age must between 0 and 100."; ageErrors.Add(info); if (!customerErrors.ContainsKey("Age")) customerErrors.Add("Age", ageErrors); raiseErrorEvent = true; } else { if (customerErrors.ContainsKey("Age")) { customerErrors.Remove("Age"); raiseErrorEvent = true; } _age = value; RaisePropertyChanged("Age"); } if (raiseErrorEvent && ErrorsChanged != null) ErrorsChanged(this, new DataErrorsChangedEventArgs("Age")); } } #region INotifyDataErrorInfo Members public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; public System.Collections.IEnumerable GetErrors(string propertyName) { if (propertyName != null) { if (customerErrors.ContainsKey(propertyName)) return customerErrors[propertyName]; } return null; } public bool HasErrors { get { throw new NotImplementedException(); } } #endregion } } XAML Code: <Grid Grid.Row="1" DataContext="{Binding Customer, Source={StaticResource Locator}}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="100" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <TextBlock Name="textBlock1" Text="Name" Margin="6" Grid.ColumnSpan="1" /> <TextBlock Grid.Row="1" Name="textBlock2" Text="Age" Margin="6" Grid.ColumnSpan="1" /> <TextBox Name="tbName" Grid.Column="1" Grid.Row="0" Text="{Binding Path=Name, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" /> <TextBox Name="tbAge" Grid.Column="1" Grid.Row="1" Text="{Binding Path=Age, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" /> </Grid>