Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在后面的代码中:
musicChooser.SetBinding(ComboBox.SelectedIndexProperty, musicIndexBinding);
当另一个按钮单击时:
musicChooser.SelectedIndex = -1;
然后绑定停止了,为什么?
-1您通过在下一行中显式设置显式删除了绑定。
-1
如果要重置绑定目标,则需要将绑定源(在本例中为musicIndexBinding)值重置为-1并将mucisChooser其拾取。
mucisChooser