我有一个基于 Prism 的应用程序。
这是我的外壳:
<Window x:Class="AvarioCRM3.ShellV2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cal="http://www.codeplex.com/CompositeWPF" >
<DockPanel LastChildFill="True">
<Border
Padding="10"
DockPanel.Dock="Top"
Background="#ddd">
<DockPanel>
<ItemsControl
Name="MainNavigationPanel"
cal:RegionManager.RegionName="MainNavigationPanel"
DockPanel.Dock="Top"/>
</DockPanel>
</Border>
</DockPanel>
</Window>
在我的MenuModule中,我向该区域添加了一个视图,它显示正常:
public void Initialize()
{
MainNavigationPresenter mainNavigationPresenter = this.container.Resolve<MainNavigationPresenter>();
IRegion mainRegion = this.regionManager.Regions["MainNavigationPanel"];
mainRegion.Add(new TestView());
}
问题是:我不想在我的外壳中使用ItemsControl,我想要一个ContentControl,但是当我使用 ContentControl 时,它什么也没有显示。
为什么 ItemsControl 会显示我的视图而 ContentControl 什么也不显示?