OneWay binding for ToggleButton's IsChecked property in WPF

后端 未结 1 1629
北海茫月
北海茫月 2021-02-15 08:01

I have a ToggleButton with its IsChecked property bound to a property using a OneWay binding.



        
1条回答
  •  鱼传尺愫
    2021-02-15 08:32

    This is by design when using oneway data binding. Add the attached property PresentationTraceSources.TraceLevel=High to your binding and you will see when it gets disconnected. This link describes the problem as well (without offering any solution): Debugging Data Binding in WPF

    The way I normally solve it is to use a command for user interaction and code behind to change the control appearance because of some changed properties.

    0 讨论(0)
提交回复
热议问题