예제 #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 프로젝트: 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));
        }