jby*_*yrd 3 data-binding mvvm xamarin xamarin.forms
有没有办法以编程方式取消绑定?就像是:
myLabel.UnsetBinding(Label.TextColorProperty);
Run Code Online (Sandbox Code Playgroud)
肯定有办法做到这一点?
Kei*_*ome 10
您正在寻找RemoveBinding()方法:https://developer.xamarin.com/api/member/Xamarin.Forms.BindableObject.RemoveBinding/p/Xamarin.Forms.BindableProperty/
对于你的例子:
myLabel.RemoveBinding(Label.TextColorProperty);
Run Code Online (Sandbox Code Playgroud)