private ChangingHandlers([NotNull] BindableChangingAsync <T> @async) { if (@async == null) { throw new ArgumentNullException(nameof(@async)); } this.sync = null; this.async = async; }
public static void SetOnce <T>(this Bindable <T> bindable, T value) { var version = bindable.Version; BindableChanging <T> currentAuthStateOnChanging = (Bindable <T> sender, ref T val, T prev, ref bool cancel) => { cancel |= sender.Version > version; }; bindable.Changing += currentAuthStateOnChanging; try { bindable.Value = value; } finally { bindable.Changing -= currentAuthStateOnChanging; } }
public static BindResult BindOnChanging <T>([NotNull] this Bindable <T> bindable, BindableChanging <T> handler) { bindable.Changing += handler; return(new BindResult(null, () => bindable.Changing -= handler)); }
public int CompareTo(BindableChanging <T> other) { return(Comparer <BindableChanging <T> > .Default.Compare(this.sync, other)); }