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
853 B
26 lines
853 B
using System.Collections.Generic;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Microsoft.Windows.Controls.PropertyGrid.Editors
|
|
{
|
|
public abstract class ComboBoxEditor : TypeEditor<System.Windows.Controls.ComboBox>
|
|
{
|
|
protected override void SetValueDependencyProperty()
|
|
{
|
|
ValueProperty = System.Windows.Controls.ComboBox.SelectedItemProperty;
|
|
}
|
|
|
|
protected override void ResolveValueBinding(PropertyItem propertyItem)
|
|
{
|
|
SetItemsSource(propertyItem);
|
|
base.ResolveValueBinding(propertyItem);
|
|
}
|
|
|
|
protected abstract IList<object> CreateItemsSource(PropertyItem propertyItem);
|
|
|
|
private void SetItemsSource(PropertyItem propertyItem)
|
|
{
|
|
Editor.ItemsSource = CreateItemsSource(propertyItem);
|
|
}
|
|
}
|
|
}
|
|
|