prism 中的Region能否动态加载

Topics: Prism v4 - WPF 4
Mar 4, 2011 at 4:32 AM
Edited Mar 4, 2011 at 4:36 AM

    <TabControl x:Name="tab" ItemsSource="{Binding NavigationItems,Mode=TwoWay}" >
            <TabControl.ItemTemplate>
            <DataTemplate>
                <DockPanel>
                    <Label Content="{Binding Path=Content,Mode=TwoWay}" DockPanel.Dock="Top"></Label>
                </DockPanel>   
            </DataTemplate>        
        </TabControl.ItemTemplate>
        <TabControl.ContentTemplate>
            <DataTemplate>
                <ContentControl Prism:RegionManager.RegionName="{Binding Name}">
                    
                </ContentControl>
            </DataTemplate>
        </TabControl.ContentTemplate>
    </TabControl>

通过

regionManager.RegisterViewWithRegion(RegionNames.P_PLANNAVIGATION, typeof(PlanNavigationView));

激活界面时,加载的是第一个界面

Developer
Mar 4, 2011 at 3:08 PM
Edited Mar 4, 2011 at 3:08 PM

Hi,

You might find the following thread useful for your scenario:

Region defined in a view is not added to RegionManger.Regions collection

Also, it could be useful if you could provide us with further details about your question in English.

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

Mar 21, 2011 at 7:12 AM

谢谢你的回复!