简体   繁体   中英

How To Reset a Binding from Code Behind

on a Window I have a Tab Control containing a Control in each tab item and a Slider in the Status bar that has to be Bound on the fly to a Field in the Currently active TabItem control. I Will bind it using the code behind, but seeing that the user can switch multiple times from a tab to another and that the control has a SetBinding method but not a ResetBinding method I was wondering if There was Something to clear the Binding before setting the new control value something like:

myslider.RemovePreviousBinding
...
mySlider.SetBinding(Slider.Value, mynewBinding);

Or it does not bother and the previous binding is reset when I set the new one. I don't like the Idea of having memory leaks or multiple bindings making strange behaviors to the controls. Thank you in advance

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM