Example #1
0
File: View.cs Project: 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)));
 }
Example #2
0
File: View.cs Project: delort/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 ?? Transmuter.Default.GetConverter <TPropertyType, bool>();
            var toState        = Transmuter.Default.GetConverter <bool, ViewStates>();
            var stateconverter = new TypedConverter <TPropertyType, ViewStates>(new ChainConverter(converter, toState));

            return(binder.Visibility(property, stateconverter));
        }