private void CreateComboboxControl(NameAttribute displayNameAttribute, RequiredAttribute requiredAttribute, ConfigEditorAttribute editorTypeAttribute, Binding b) { var dropDownControl = new ConfigComboBoxControl(); dropDownControl.ConfigItemDisplayName = _localController.GetLocalString(displayNameAttribute.LocalType, displayNameAttribute.DisplayName); dropDownControl.SourceList = (ComboBoxList)Activator.CreateInstance(editorTypeAttribute.SourceListType); dropDownControl.SetBinding(ConfigComboBoxControl.SelectedValueProperty, b); dropDownControl.WaterMarkText = requiredAttribute != null?_localController.GetLocalStrings <SDGuiStrings>().Mandatory : _localController.GetLocalStrings <SDGuiStrings>().Optional; dropDownControl.WaterMarkColor = requiredAttribute != null ? (SolidColorBrush)TryFindResource("Color_FadedRed") : (SolidColorBrush)TryFindResource("Color_FadedGray"); configItemPanel.Children.Add(dropDownControl); }
private void CreateComboboxControl(NameAttribute displayNameAttribute, RequiredAttribute requiredAttribute, ConfigEditorAttribute editorTypeAttribute, Binding b) { var dropDownControl = new ConfigComboBoxControl(); dropDownControl.ConfigItemDisplayName = _localController.GetLocalString(displayNameAttribute.LocalType, displayNameAttribute.DisplayName); dropDownControl.SourceList = (ComboBoxList)Activator.CreateInstance(editorTypeAttribute.SourceListType); dropDownControl.SetBinding(ConfigComboBoxControl.SelectedValueProperty, b); dropDownControl.WaterMarkText = requiredAttribute != null ? _localController.GetLocalStrings<SDGuiStrings>().Mandatory : _localController.GetLocalStrings<SDGuiStrings>().Optional; dropDownControl.WaterMarkColor = requiredAttribute != null ? (SolidColorBrush)TryFindResource("Color_FadedRed") : (SolidColorBrush)TryFindResource("Color_FadedGray"); configItemPanel.Children.Add(dropDownControl); }