Hi,
One way is to use the ItemsSource attribute to create your own content for the ComboBox. When using System.Linq :
One way is to use the ItemsSource attribute to create your own content for the ComboBox. When using System.Linq :
public class MyUserObject
{
[ItemsSource( typeof( MyFontItemsSource ) )]
public FontFamily FontFamily { get; set; }
}
public class MyFontItemsSource : IItemsSource
{
public Xceed.Wpf.Toolkit.PropertyGrid.Attributes.ItemCollection GetValues()
{
var fonts = Fonts.SystemFontFamilies.OrderBy(x => x.ToString());
var fontCollection = new Xceed.Wpf.Toolkit.PropertyGrid.Attributes.ItemCollection();
foreach( FontFamily fontFamily in fonts )
{
fontCollection.Add( fontFamily );
}
return fontCollection;
}
}
var selectedObject = new MyUserObject();
_propertyGrid.SelectedObject = selectedObject;