Support MvvmCross-Bindings to IObservable<T>-properties in view models.
By overriding the initialization process in MvvmCross to use ObservableSourceBindingFactory
, view models may expose properties of Type IObservable<T>
. The changes in the Observable will then be observed by the binding and be reflected by the UI.
Note:
- This does only work for properties of type
IObservable<T>
whereT
is a reference type. If you need this for value types, project your observable toIObservable<object>
by boxing the values. - The view model must ensure that the changes on the observable are observed on the UI-Thread. You may use the
ObserveOn(IMvxMainThreadDispatcher)
extension method for this.