Hey,
Right now in my application I have a bunch of lists of data that I use as the ItemsSource for my combo editors. I make sure that there's only one copy of each of these lists. I was wondering if I should be using the ComboBoxItemsProvider instead. That is, should I, for each of my lists, make a corresponding single-copy ComboBoxItemsProvider with the list as its ItemsSource? Is there a performance benefit for using the ComboBoxItemsProvider in this way, considering I already make sure my lists only have a single copy? In particular I'm thinking of the scenario where I want a combo editor for a grid field. Is the list being set as the itemssource or the ComboBoxItemsProvider being set as the itemsprovider more efficient?
I also wanted to ask another combo editor related question. To attach the items source to a combo editor I've made an enum identifying each type of drop down list in my system and an attached property that tracks a value of this enum for a combo editor. For example, my XamComboEditor tag looks something like the following:
<XamComboEditor a:DropDownSettings.DropDown="Person" />
The attached property uses the enum value to get to the single copy of the corresponding drop down list and then sets the ItemsSource, DisplayMemberPath, ValuePath, and ValueType (I had trouble getting drop downs to work if I didn't set the value type) of the combo editor.
When I use a combo editor in a XamDataGrid column, I set up a style that just sets this attached property to the drop down enum value that I want for that column (i.e. <Setter Property="a:DropDownSettings.DropDown" Value="Person" />). So far in my initial lightweight tests this all functions perfectly. I was wondering if there is any reason that I shouldn't be setting up combo editors in this way (combo editors both in the grid or just in a panel outside of the grid)?
Thanks