コード例 #1
0
 public TValue this[string key]
 {
     get
     {
         return((TValue)control.GetValue(group.GetDotvvmProperty(key)));
     }
     set
     {
         control.SetValue(group.GetDotvvmProperty(key), value);
     }
 }
コード例 #2
0
ファイル: BindingCombinator.cs プロジェクト: yannduran/dotvvm
 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);
         }
コード例 #3
0
        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));
            }
        }