public TValue this[string key] { get { return((TValue)control.GetValue(group.GetDotvvmProperty(key))); } set { control.SetValue(group.GetDotvvmProperty(key), value); } }
public static void AndAssignProperty(this DotvvmBindableObject obj, DotvvmProperty property, object value) { if (property.PropertyType != typeof(bool)) { throw new NotSupportedException($"Can only AND boolean properties, {property} is of type {property.PropertyType}"); } if (!obj.IsPropertySet(property)) { obj.SetValue(property, value); } else { if (value is bool b && !b) { obj.SetValue(property, false); }
public static void CopyProperty(DotvvmBindableObject source, DotvvmProperty sourceProperty, DotvvmBindableObject target, DotvvmProperty targetProperty) { var binding = source.GetValueBinding(sourceProperty); if (binding != null) { target.SetBinding(targetProperty, binding); } else { target.SetValue(targetProperty, source.GetValue(sourceProperty)); } }