public ChoiceHelper(ListControl list) { _list = list; }
public static IDisposable BindTo <T>(this IObservable <CollectionAddRemoveEvent <T> > This, ListControl listControl) => This.Subscribe(x => { if (x.IsAdded) { listControl.Add(x.Value).SubscribeAndForget(); } else { listControl.Remove(x.Value); } });
public static void Bind <T>(this IBinder This, IObservable <CollectionAddRemoveEvent <T> > source, ListControl target) { if (target != null) { source .Subscribe(x => { if (x.IsAdded) { target.Add(x.Value).SubscribeAndForget(); } else { target.Remove(x.Value); } }) .AddTo(This); } }
public static IDisposable BindTo <T>(this IReadOnlyReactiveCollection <T> This, ListControl listControl) => This.ObserveCurrentAddRemove().BindTo(listControl);
public static void Bind <T>(this IBinder This, IReadOnlyReactiveCollection <T> source, ListControl target) { if (target != null) { This.Bind(source.ObserveCurrentAddRemove(), target); } }