I have a login page in my application and on the page i have a textbox that shows the error in case of wrong username/password, etc. I am updating the error from view model, but the view is not changing automatically.
The viewmodel implements INotifyPropertyChanged interface.
Error definition.
string _error;
public string Error
{
get { return _error; }
set
{
_error = value;
NotifyPropertyChanged("Error");
}
}
INotify Event Handlers
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
update
_error = "Wrong username/password!";
xaml
<TextBlock Text="{Binding Error, UpdateSourceTrigger=PropertyChanged}"/>
What else am i missing?