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?