コード例 #1
0
 public PropertyBinding(ViewBindingSet <T> set, int ResourceId, MemberExpression expression)
 {
     this.Set    = set;
     this.View   = set.view.FindViewById(ResourceId);
     this.member = (PropertyInfo)expression.Member;
     this.Name   = member.Name;
 }
コード例 #2
0
        public PropertyBindingGeneric(ViewBindingSet <T> set, int ResourceId, MemberExpression expression, string propertyName, ValueConverter.convertDel convert) : base(set, ResourceId, expression)
        {
            Type t = View.GetType();

            targetProperty = t.GetProperty(propertyName);
            this.convert   = convert;
            //CheckBox.CheckedChange += (sender, e) => {ToVM(CheckBox.Checked);};
        }
コード例 #3
0
 public PropertyBindingDateTime(ViewBindingSet <T> set, int ResourceId, Expression <Func <T, DateTime> > property) : base(set, ResourceId, (MemberExpression)property.Body)
 {
     TextBox.TextChanged += (sender, e) => {
         DateTime time = DateTime.MinValue;
         if (DateTime.TryParse(TextBox.Text, out time))
         {
             ToVM(time);
         }
     };
 }
コード例 #4
0
        public static ViewBindingSet <T> FromView(View view, VMBase vm)
        {
            ViewBindingSet <T> result = null;

            All.TryGetValue(view, out result);
            if (result == null)
            {
                result     = new ViewBindingSet <T> (view, vm);
                All [view] = result;
            }
            else
            {
                result.VM = vm;
            }
            return(result);
        }
コード例 #5
0
 public PropertyBindingChecked(ViewBindingSet <T> set, int ResourceId, Expression <Func <T, bool> > property) : base(set, ResourceId, (MemberExpression)property.Body)
 {
     CheckBox.CheckedChange += (sender, e) => { ToVM(CheckBox.Checked); };
 }
コード例 #6
0
 public PropertyBindingVisibility(ViewBindingSet <T> set, int ResourceId, Expression <Func <T, Visibility> > property) : base(set, ResourceId, (MemberExpression)property.Body)
 {
 }
コード例 #7
0
 public PropertyBindingValue(ViewBindingSet <T> set, int ResourceId, Expression <Func <T, float> > property) : base(set, ResourceId, (MemberExpression)property.Body)
 {
     Slider.ProgressChanged += (sender, e) => { ToVM(Slider.Progress); };
 }
コード例 #8
0
 public PropertyBindingText(ViewBindingSet <T> set, int ResourceId, Expression <Func <T, string> > property) : base(set, ResourceId, (MemberExpression)property.Body)
 {
     TextBox.TextChanged += (sender, e) => { ToVM(TextBox.Text); };
 }