Here’s the xaml:
<TextBlock Text="{Binding Errors}" Grid.Row="3" Foreground="Red"/>
Here’s the ViewModel code:
private string _errors = "";
public string Errors
{
get { return this._errors; }
set
{
if(_errors != value)
{
_errors = value;
RaisePropertyChanged(() => Errors);
}
}
}
and then in some function I change the _errors variable
_errors = "Compiler Errors :\r\n";
But nothing happens in the TextBlock. What am I doing wrong?
You are setting
_errorsvariable directly – so noRaisePropertyChangedfired. Try to set value by