public DashPatternComboBox() : base(DashPatternListManager.Instance) { UpdateTreeViewTreeNodes(); InitializeComponent(); _itemToItemNameConverter = new DashPatternToItemNameConverter(GuiComboBox); UpdateComboBoxSourceSelection(SelectedItem); UpdateTreeViewSelection(); var valueBinding = new Binding(); valueBinding.Source = this; valueBinding.Path = new PropertyPath("SelectedItem"); valueBinding.Converter = _itemToItemNameConverter; //valueBinding.ValidationRules.Add(new ValidationWithErrorString(_itemToItemNameConverter.EhValidateText)); GuiComboBox.SetBinding(ComboBox.TextProperty, valueBinding); }
public DashPatternComboBox() : base(DashPatternListManager.Instance) { UpdateTreeViewTreeNodes(); InitializeComponent(); _itemToItemNameConverter = new DashPatternToItemNameConverter(GuiComboBox); UpdateComboBoxSourceSelection(SelectedItem); UpdateTreeViewSelection(); var valueBinding = new Binding { Source = this, Path = new PropertyPath("SelectedItem"), Converter = _itemToItemNameConverter }; //valueBinding.ValidationRules.Add(new ValidationWithErrorString(_itemToItemNameConverter.EhValidateText)); GuiComboBox.SetBinding(ComboBox.TextProperty, valueBinding); }