RegionAdapter, TabControl, TabItems, Styling - putting all together does not work

Jan 27, 2011 at 10:45 AM

I hope that someone of the community can help me with the following problem:

1.) Setup: A designer provided a clickdummy with a rich UI (WPF).

2.) The application has to be designed in a way that you can plug in functionalities provided as modules -> modular application -> Prism!

3.) I created a WPF project based on the StockTrader UI sample, all styles/templates/colors/artwork went into a separate style assembly (which can be easily substituted by a new design). The shell view contains a TabControl, which is a region name assigned, say "MainRegion".

4.) The first module implement its view as a UserControl, which contains a TabItem. The style of the shell view's TabControl and the style of the module's TabItem are globally defined by the style assembly.

5.) When the module is loaded, it injects its view, which goes to "MainRegion". The Problem is now that no exceptions or complains are reported but the new TabItem is not displayed according to its style. The following permutations yield different renderings but do not solve the issue:

a) Specify <TabItem Style="{StaticResource TabItemStyle}" ...> in the UserControl of the module.

b) Specify <Setter Property="ItemContainerStyle" Value="{StaticResource TabItemStyle}"/> in the TabControl style.

Is it possible that I have to perform another action after injecting the new TabItem to "refresh" the TabControl?

Any help is highly appreciated! Thx.