public static Binder <TSource, TView> Visible <TSource, TView, TPropertyType>(this Binder <TSource, TView> binder, Expression <Func <TSource, TPropertyType> > property, IConverter <TPropertyType, bool> converter = null) where TSource : class where TView : View { converter = converter ?? Converters.Default <TPropertyType, bool>(); return(binder.Visibility(property, converter.Chain(PlatformConverters.BoolToViewState))); }
public static Binder <TSource, TView> Hidden <TSource, TView, TPropertyType>(this Binder <TSource, TView> binder, Expression <Func <TSource, TPropertyType> > property, IConverter <TPropertyType, bool> converter = null) where TSource : class where TView : View { converter = converter ?? Converters.Default <TPropertyType, bool>(); return(binder.Visible(property, converter.Chain(Converters.Invert))); }
public static Binder <TSource, UISegmentedControl> Selected <TSource, TPropertyType>(this Binder <TSource, UISegmentedControl> binder, Expression <Func <TSource, TPropertyType> > property, IConverter <TPropertyType, int> converter = null) where TSource : class { converter = converter ?? Converters.Default <TPropertyType, int>(); var finalConverter = converter.Chain(Converters.Default <int, nint>()); return(binder.Property <TPropertyType, nint, EventArgs>(property, b => b.SelectedSegment, nameof(UISegmentedControl.ValueChanged), finalConverter)); }
public static Binder <TSource, UISwitch> Off <TSource, TPropertyType>(this Binder <TSource, UISwitch> binder, Expression <Func <TSource, TPropertyType> > property, IConverter <TPropertyType, bool> converter = null) where TSource : class { converter = converter ?? Converters.Default <TPropertyType, bool>(); return(binder.Off(property, converter.Chain(Converters.Invert))); }