public MainWindowViewModel() { var rnd = new Random(); for (int i = 0; i < 100; i++) { var lookupItem = new LookupItem { Name = string.Format("{0,15}", rnd.Next()) }; Items.Add(new LookupComboBoxItem(lookupItem)); } _itemsViewSource.SortDescriptions.Add(new System.ComponentModel.SortDescription("Name", System.ComponentModel.ListSortDirection.Ascending)); _itemsViewSource.Source = Items; SelectedIndex = 0; }
public LookupComboBoxItem(LookupItem item) { Item = item; _displayValue = Item.Name; }