3

Caliburn Micro を使用している WPF プロジェクトに取り組んでいます。ビューを 2 回目に開いたときに、ビュー内のコントロールが更新されないという問題が発生しています。初めてデータ バインディングが正常に機能します。

ビューが 2 回目に呼び出されたときに ViewModel をステップ実行すると、データ バインドされたプロパティが新しい値を取得し、NotifyOfPropertyChange() を呼び出していることがわかりますが、変更は UI に反映されていません。何か案は?マイ ビューの継承PropertyChangedBase()

以下はビューモデルの私のプロパティです

public string Info
{
    get { return _info; }
    set { _info = value; NotifyOfPropertyChange(() => Info); }
}

public IEnumerable<ComponentInfo> BondableComponents
{
    get { return _bondableComponents; }
    set { _bondableComponents = value; NotifyOfPropertyChange(() => BondableComponents); }
}

とXaml

<TextBox Name="Info" Grid.Row="0" Grid.Column="0" IsReadOnly="True"/>
<DataGrid ItemsSource="{Binding BondableComponents}">
4

1 に答える 1