All the controls missing in WPF. Over 1 million downloads.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
776 B

using System.Collections.Generic;
using System.Windows.Controls;
namespace Microsoft.Windows.Controls.PropertyGrid.Editors
{
public abstract class ComboBoxEditor : TypeEditor<ComboBox>
{
protected override void SetValueDependencyProperty()
{
ValueProperty = ComboBox.SelectedItemProperty;
}
public override void Attach(PropertyItem propertyItem)
{
SetItemsSource(propertyItem);
base.Attach(propertyItem);
}
protected abstract IList<object> CreateItemsSource(PropertyItem propertyItem);
private void SetItemsSource(PropertyItem propertyItem)
{
Editor.ItemsSource = CreateItemsSource(propertyItem);
}
}
}