MainWindow に静的リストがあります。変更が発生した場合、CurrValue はすぐに設定されます。
public static List<varVisu> varVisuListDll = new List<varVisu>();
私のクラスには、 INotifyPropertyChanged 実装があります
public string m_CurrValue;
public event PropertyChangedEventHandler PropertyChanged;
protected void Notify(string propertyName)
{
if (this.PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public string CurrValue
{
get { return m_CurrValue; }
set
{
if (value != m_CurrValue)
{
//set value
m_CurrValue = value;
//notify anyone who cares about it
Notify("CurrValue");
}
}
}
これは問題なく動作しますが、今回は Window#2 の Textbox (Text)をこの List の最初の項目 (varVisuListDll[0].CurrValue) にバインドしたいと考えています。
TextBox.Text をこの値にバインドするにはどうすればよいですか (Text={Path, UpdateSourceTrigger ...}??
<TextBox x:Name="txtManualMode" Text="{Binding ElementName=????, Path=CurrValue, UpdateSourceTrigger=PropertyChanged}"
(dtgrVariables.ItemSource=MainWindow.varVisuListDll) でテストしました。この作品の.
私を助けてください ..