示例#1
0
文件: View.cs 项目: tah-in/Wires
 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)));
 }
示例#2
0
文件: View.cs 项目: tah-in/Wires
 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)));
 }
示例#3
0
        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));
        }
示例#4
0
文件: UISwitch.cs 项目: tah-in/Wires
 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)));
 }