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.
24 lines
705 B
24 lines
705 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Microsoft.Windows.Controls.PropertyGrid.Attributes;
|
|
|
|
namespace Microsoft.Windows.Controls.PropertyGrid.Editors
|
|
{
|
|
public class ItemsSourceEditor : ComboBoxEditor
|
|
{
|
|
private ItemsSourceAttribute _attribute;
|
|
|
|
public ItemsSourceEditor(ItemsSourceAttribute attribute)
|
|
{
|
|
_attribute = attribute;
|
|
}
|
|
|
|
protected override IList<object> CreateItemsSource(PropertyItem propertyItem)
|
|
{
|
|
var instance = Activator.CreateInstance(_attribute.Type);
|
|
return (instance as IItemsSource).GetValues();
|
|
}
|
|
}
|
|
}
|
|
|