コード例 #1
0
		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);
		}
コード例 #2
0
        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);
        }