创建区域模块:
MainWindow.xaml 调用区域模块:
<Grid> <Grid.RowDefinitions> <RowDefinition Height="28"/> <RowDefinition Height="*"/> <RowDefinition Height="28"/> </Grid.RowDefinitions> <ContentControl Grid.Row="0" prism:RegionManager.RegionName="HeaderRegin" x:Name="Header"/> <ContentControl Grid.Row="2" prism:RegionManager.RegionName="FooterRegin" x:Name="Footer"/> </Grid>
MainWindow.cs 注册模块:
RegionManager.SetRegionName(Header, "HeaderRegin"); regionManager.RegisterViewWithRegion("HeaderRegin", typeof(Regions.HeaderControl)); RegionManager.SetRegionName(Footer, "FooterRegin"); regionManager.RegisterViewWithRegion("FooterRegin", typeof(Regions.FooterControl));
标签:Region,7.0,Regions,HeaderRegin,Prism,模块,SetRegionName,MainWindow From: https://www.cnblogs.com/microsoft-zh/p/18280217