Exemplo n.º 1
0
		FrameworkElement ITypeEditor.ResolveEditor(PropertyItem propertyItem)
		{
			var comboBox = new SmartComAddressComboBox { IsEditable = true, Width = double.NaN };

			var binding = new Binding("Value")
			{
				Source = propertyItem,
				Converter = new EndPointValueConverter(comboBox, SmartComAddresses.Matrix),
				Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay
			};

			BindingOperations.SetBinding(comboBox, ComboBox.TextProperty, binding);
			return comboBox;
		}
Exemplo n.º 2
0
        FrameworkElement ITypeEditor.ResolveEditor(PropertyItem propertyItem)
        {
            var comboBox = new SmartComAddressComboBox {
                IsEditable = true, Width = double.NaN
            };

            var binding = new Binding("Value")
            {
                Source    = propertyItem,
                Converter = new EndPointValueConverter(comboBox, SmartComAddresses.Matrix),
                Mode      = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay
            };

            BindingOperations.SetBinding(comboBox, ComboBox.TextProperty, binding);
            return(comboBox);
        }