I am new to the Windows Phone 7 development platform. I am trying to run a check to enter a text box. When debugging, in case of invalid input, I get the error "exception was not processed." How to fix this? This code is great for the silverlight application.
TextBox Text="{Binding Name, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" />
private string _name;
public String Name
{
get { return _name; }
set {
if (string.IsNullOrEmpty(value))
{
throw new Exception("invalid name");
}
_name = value;
OnPropertyChanged("Name");
}
}
source
share