BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
private string _name;
public string Name {
get { return _name; }
set {
SetProperty(ref _name, value);
OnPropertyChanged("Name");
OnPropertyChanged("Error");
}
}
XAML Text="{Binding Name, Mode=TwoWay}" Height="30" Width="250" Margin="20,2,0,8" sfData:DataValidation.PropertyPath="Name" sfData:DataValidation.NotifyOnDataErrors="True"> </syncfusion:SfTextBoxExt> <syncfusion:SfTextBoxExt x:Name="TextBox" Text="{Binding FatherName, Mode=TwoWay}" Height="30" Width="250" Margin="20,2,0,8" sfData:DataValidation.PropertyPath="FatherName" sfData:DataValidation.NotifyOnDataErrors="True"> </syncfusion:SfTextBoxExt>
C# public class TextBoxExtProperties : NotificationObject, IDataValidation { private string name;
public string Name { get { return name; } set { name = value; RaisePropertyChanged("Name"); RaisePropertyChanged("Error"); } }
private string fathername;
public string FatherName { get { return fathername; } set { fathername = value; RaisePropertyChanged("FatherName"); RaisePropertyChanged("Error"); } } public string Error { get { if (String.IsNullOrEmpty(Name)) { return "Name field required."; } if (String.IsNullOrEmpty(FatherName)) { return "Father Name field required."; } return ""; } }
public string this[string columnname] { get { switch (columnname) { case "Name": if (String.IsNullOrEmpty(Name)) { return "Name field required."; } break; case "FatherName": if (String.IsNullOrEmpty(FatherName)) { return "FatherName field required."; } break; } return ""; } } } |
Please let us know if you need further assistance on this.