static void TaskSetAutomationName(FrameworkElement fe, string route, PropertyRoute context) { if (fe.NotSet(AutomationProperties.NameProperty)) { AutomationProperties.SetName(fe, context?.ToString() ?? ""); } }
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); } }
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()); } }
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); } }
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); } }