I would actually prefer using a DynamicResource
in this context, but it's impossible:
<Page.Resources>
<CollectionViewSource
x:Key="CategoriesCollection"
Source="{Binding Context.CatsList, Source={x:Static Application.Current}}"/>
<DataGridComboBoxColumn
Header="Category"
ItemsSource="{Binding Source={StaticResource CategoriesCollection}}"
DisplayMemberPath="Title" />
I want to make that the CollectionViewSource
should only be initialized on demand (i.e. when the first DataGridComboBoxColumn
is created), is there a xamly way to do it?