TextBlock
モデルのプロパティにバインドするものがあります。ウィンドウにバインドされているビューモデルに座っているモデル。
<TextBlock Text="{Binding MyModel.TextVar,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
TextVarは、Notifyの関数を呼び出す文字列プロパティです。
だから、なぜそれが機能しないのか分かりません。(OutPutにはバインディングエラーはありません)。
編集:
string _textVar;
public string TextVar
{
get
{
return _textVar;
}
set
{
_textVar= value;
NotifyPropertyChanged("TextVar");
}
}
private void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)-- HERE THE PROPBLEM, IT ARRIVE NULL
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public event PropertyChangedEventHandler PropertyChanged;