Search code examples
iosdata-bindingxamarinmvvmcrossfluent

How to unbind or clear MvvmCross fluent bindings


I am using MVVMCross fluent bindings in a Xamarin iOS project I am using a MvxFluentDescriptionSet to set up my bindings.

Is there anyway to unbind for clear these bindings? The API only allows me to Apply the bindings. Am I missing something or is it impossible.

The reason I want to do this is that I have a custom control which I need to dispose. But I get binding exception at this point because it is trying to access the control I have just disposed.

Is there anyway round this?


Solution

  • Since you're on iOS, you need to use BindingContext.ClearAllBindings() (or the extension method this.ClearAllBindings() which, under the hood, calls the first method) in order to clear the bindings for some context.