Example #1
0
 static void TaskSetAutomationName(FrameworkElement fe, string route, PropertyRoute context)
 {
     if (fe.NotSet(AutomationProperties.NameProperty))
     {
         AutomationProperties.SetName(fe, context?.ToString() ?? "");
     }
 }
Example #2
0
 static void TaskSetCollaspeIfNull(FrameworkElement fe, string route, PropertyRoute context)
 {
     if (GetCollapseIfNull(fe) && fe.NotSet(UIElement.VisibilityProperty))
     {
         Binding b = new Binding(route)
         {
             Mode = BindingMode.OneWay,
             Converter = Converters.NullToVisibility,
         };
         
         fe.SetBinding(FrameworkElement.VisibilityProperty, b);
     }
 }
Example #3
0
        public static void TaskSetLabelText(FrameworkElement fe, string route, PropertyRoute context)
        {
            DependencyProperty labelText = LabelPropertySelector.TryGetValue(fe.GetType());

            if (labelText != null && fe.NotSet(labelText))
            {
                fe.SetValue(labelText, context.PropertyInfo.NiceName());
            }
        }
Example #4
0
        public static void TaskSetIsReadonly(FrameworkElement fe, string route, PropertyRoute context)
        {
            bool isReadOnly = context.PropertyRouteType == PropertyRouteType.FieldOrProperty && context.PropertyInfo.IsReadOnly();

            if (isReadOnly && fe.NotSet(Common.IsReadOnlyProperty) && (fe is ValueLine || fe is EntityLine || fe is EntityCombo || fe is TextArea))
            {
                Common.SetIsReadOnly(fe, isReadOnly);
            }
        }
Example #5
0
        public static void TaskSetTypeProperty(FrameworkElement fe, string route, PropertyRoute context)
        {
            DependencyProperty typeProperty = TypePropertySelector.TryGetValue(fe.GetType());

            if (typeProperty != null && fe.NotSet(typeProperty))
            {
                fe.SetValue(typeProperty, context.Type);
            }
        }