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; }
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);}; }
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); } }; }
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); }
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); }; }
public PropertyBindingVisibility(ViewBindingSet <T> set, int ResourceId, Expression <Func <T, Visibility> > property) : base(set, ResourceId, (MemberExpression)property.Body) { }
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); }; }
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); }; }