I’m looking for a way to bind a datatemplate which is in a resource file that my MainWindow accesses, but only after a Task that is running in the viewmodel has completed.
The idea was to load a lot of data while the view displays with a little progress area… when the progress is done… then the data should be binded… is the dependency property that allows for this?
<DataTemplate x:Key="TabsTemplate">
<ItemsControl ItemsSource="{Binding}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<UserControls:TabButton Command="{Binding Path=Tab}" Content="{Binding Path=DisplayName}" Template="{Utilities:BindableResource {Binding Path=TemplateResource}}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
Figured it out…
Tabs.GetBindingExpression(ContentControl.ContentProperty).UpdateTarget();
Works perfect after the progress is completed.