Note - the classes that I have are EntityObject classes!
I have the following class:
public class Foo { public Bar Bar { get; set; } } public class Bar : IDataErrorInfo { public string Name { get; set; } #region IDataErrorInfo Members string IDataErrorInfo.Error { get { return null; } } string IDataErrorInfo.this[string columnName] { get { if (columnName == "Name") { return "Hello error!"; } Console.WriteLine("Validate: " + columnName); return null; } } #endregion }
XAML is as follows:
<StackPanel Orientation="Horizontal" DataContext="{Binding Foo.Bar}"> <TextBox Text="{Binding Path=Name, ValidatesOnDataErrors=true}"/> </StackPanel>
I set a breakpoint and Console.Writeline to check there - I have no breaks. Verification is not performed. Can someone just push me to the place where my mistake lies?
Jefim source share