protected void SetBinding( ref MVVMBinding binding, MVVMBinding value, MVVMFunc <object> getTargetValue = null, Action <object> setTargetValue = null, MVVMAction unbind = null, MVVMBindingMode defaultMode = MVVMBindingMode.OneWay, MVVMUpdateSourceTrigger defaultUpdateSourceTrigger = MVVMUpdateSourceTrigger.PropertyChanged, bool isDataContext = false, [CallerMemberName] string propertyName = null ) { if (!isDataContext && binding != null) { Bindings.Remove(binding); } binding = value; if (binding == null) { return; } binding.Control = this; if (propertyName == null) { propertyName = MVVMAPI.GetCallerMemberName(); } binding.TargetPropertyName = propertyName; binding.IsDataContext = isDataContext; binding.OnGetTargetValue = getTargetValue; binding.OnSetTargetValue = setTargetValue; binding.OnUnbind = unbind; binding.DefaultMode = defaultMode; binding.DefaultUpdateSourceTrigger = defaultUpdateSourceTrigger; if (!isDataContext) { Bindings.Add(binding); } }
public MVVMBinding( MVVMBindingMode mode = MVVMBindingMode.Default, MVVMUpdateSourceTrigger updateSourceTrigger = MVVMUpdateSourceTrigger.Default, string path = null, object value = null, MVVMRelativeSource relativeSource = null, string elementName = null, MVVMControlBase element = null, bool validatesOnExceptions = false ) { if (element != null) { Type = MVVMBindingType.Element; } else if (elementName != null) { Type = MVVMBindingType.ElementName; } else if (relativeSource != null) { Type = MVVMBindingType.RelativeSource; } else if (value != null) { Type = MVVMBindingType.Value; } else { Type = MVVMBindingType.Path; } _Mode = mode; _UpdateSourceTrigger = updateSourceTrigger; Path = path; TargetValue = value; ElementName = elementName; Element = element; ValidatesOnExceptions = validatesOnExceptions; }
public MVVMBinding(MVVMControlBase element, string path, MVVMBindingMode mode, MVVMUpdateSourceTrigger updateSourceTrigger) : this(element, path, mode) { _UpdateSourceTrigger = updateSourceTrigger; }
public MVVMBinding(MVVMRelativeSource relativeSource, MVVMBindingMode mode) : this(relativeSource) { _Mode = mode; }
public MVVMBinding(MVVMControlBase element, MVVMBindingMode mode) : this(element) { _Mode = mode; }
public MVVMBinding(MVVMControlBase element, string path, MVVMBindingMode mode) : this(element, path) { _Mode = mode; }
public MVVMBinding(string elementName, string path, MVVMBindingMode mode) : this(elementName, path) { _Mode = mode; }
public MVVMBinding(string elementName, string path, MVVMBindingMode mode, MVVMUpdateSourceTrigger updateSourceTrigger) : this(elementName, path, mode) { _UpdateSourceTrigger = updateSourceTrigger; }
public MVVMBinding(MVVMRelativeSource relativeSource, string path, MVVMBindingMode mode) : this(relativeSource, path) { _Mode = mode; }
public MVVMBinding(MVVMRelativeSource relativeSource, string path, MVVMBindingMode mode, MVVMUpdateSourceTrigger updateSourceTrigger) : this(relativeSource, path, mode) { _UpdateSourceTrigger = updateSourceTrigger; }
public MVVMBinding(object value, MVVMBindingMode mode, MVVMUpdateSourceTrigger updateSourceTrigger) : this(value, mode) { _UpdateSourceTrigger = updateSourceTrigger; }
public MVVMBinding(MVVMControl element, MVVMBindingMode mode, MVVMUpdateSourceTrigger updateSourceTrigger) : this(element, mode) { _UpdateSourceTrigger = updateSourceTrigger; }
public MVVMBinding(object value, MVVMBindingMode mode) : this(value) { _Mode = mode; }
public MVVMBinding(string path, MVVMBindingMode mode, MVVMUpdateSourceTrigger updateSourceTrigger) : this(path, mode) { _UpdateSourceTrigger = updateSourceTrigger; }
public MVVMBinding(string path, MVVMBindingMode mode) : this(path) { _Mode = mode; }
public MVVMBinding(MVVMBindingMode mode, MVVMUpdateSourceTrigger updateSourceTrigger) : this(mode) { _UpdateSourceTrigger = updateSourceTrigger; }
public MVVMBinding(MVVMBindingMode mode) : this() { _Mode = mode; }