1

I followed from the quick start example about UICompositon. In my case I had a project A to hold the TabControl, a project B to hold the DataGrid which act as Content to be injected into the TabControl.

The TabControl has no viewModels, It uses

<Style TargetType="{x:Type TabItem}" x:Key="HeaderStyleS">
        <Setter Property="Header"
                Value="{Binding RelativeSource={RelativeSource Self}, 
                Path=Content.DataContext.ViewName}" />
</Style>
<TabControl regions:RegionManager.RegionName="TabRegion" ItemContainerStyle="{StaticResource HeaderStyleS}"></TabControl>

Project A is only responsible to inject itself into the main shell which is defined in project C;

regionManager.RegisterViewWithRegion("MiddleRegion", () => container.Resolve<MainTabWindow>());

Project B is only responsible to inject itself into region TabRegion, which is defined in A.

regionManager.RegisterViewWithRegion("TabRegion", () => container.Resolve<MetroDataGrid>());

Now The problem is the view-B's Datagrid is not shown on the Gui. The only part works is the ViewName,it verifies Content.Datatext is used correctly.But why the Content DataGrid is not shown?

enter image description here

baozi
  • 679
  • 10
  • 30
  • Adding PRISM Regions in TabControl can be done using RegionAdaptors concept in PRISM. – Ayyappan Subramanian Dec 19 '14 at 17:00
  • @AyyappanSubramanian Actually what happens is the default state of the Selected Tabitem is set to none. So After click, It shows it needs to show. I can't believe I'm stuck for 2 hours. – baozi Dec 19 '14 at 18:40

0 Answers0