バインディング/依存関係のプロパティを強制していて、概念を根本的に理解していないことに気づきました。
依存関係プロパティは次のとおりです。
public string Problem
{
get { return (string)GetValue(ProblemProperty); }
set { SetValue(ProblemProperty, value); }
}
public static readonly DependencyProperty ProblemProperty =
DependencyProperty.Register(
"Problem",
typeof(string),
typeof(TextBox));
XAMLは次のとおりです。
<TextBlock Text="{Binding Path=Problem}"/>
オブジェクトのコンストラクターでプロパティを手動でProblem
値に設定していますが、それに応じて更新されませんTextBlock
。。。何か案は?バインディングを試しましたがMode="OneWay"
、Mode="TwoWay"
まだ機能しません。
これは自動的に機能するはずだと思いましたか?それとも私は根本的に何かが間違っていますか?
ありがとう