明示的なバインディングが SelectedValue に設定された ListBox があります。
SelectedValue="{Binding Path=Property, UpdateSourceTrigger=Explicit}"
ListBox の ItemSource は ObservableCollection です。
ListBox の項目を選択して Enter キーを押すと、次のようにプロパティ値が更新されます。
BindingExpression be = listBox.GetBindingExpression(ListBox.SelectedValueProperty);
be.UpdateSource();
今、私はこの問題を抱えています: ウィンドウで特定のアクションによって ListBox の ItemsSource をリセットする必要があり、ItemsSource の「Clear」メソッドを呼び出すと、SelectedValue へのバインディングが (null に) 更新されます! なんで?
どうすれば回避できますか?