这是xml:
<TextBlock Text="{Binding Errors}" Grid.Row="3" Foreground="Red"/>
这是 ViewModel 代码:
private string _errors = "";
public string Errors
{
get { return this._errors; }
set
{
if(_errors != value)
{
_errors = value;
RaisePropertyChanged(() => Errors);
}
}
}
然后在一些函数中我改变了_errors
变量
_errors = "Compiler Errors :\r\n";
但是在 TextBlock 中什么也没有发生。我究竟做错了什么?