1
votes
<DockPanel LastChildFill="True">
    <UserControl prism:RegionManager.RegionName="{x:Static inf:RegionNames.ShellHeaderRegion}" DockPanel.Dock="Top" />
    <UserControl prism:RegionManager.RegionName="{x:Static inf:RegionNames.ShellStatusRegion}" DockPanel.Dock="Bottom" />
    <UserControl prism:RegionManager.RegionName="{x:Static inf:RegionNames.ShellContentRegion}"/>
</DockPanel>

Greetings,

I am building a WPF Prism app with multiple modules. Some modules utilize all 3 regions I defined. (Header, Content, Status). Other modules only utilize the content region. The problem is when I navigate from one module to another using IRegionManager.RequestNavigate(), the ShellHeaderRegion and ShellContentRegion still contain the injected views. I would like the ability to deactivate these views, while keeping the ability to reactivate these views when I call IRegionNavigationJournal.GoBack(). Is there a proper way to do this?

1

1 Answers

0
votes

After running a few tests and reading the source code I was able to find a suitable solution. If you want to hide a Region you will need to create an empty UserControl. Since it has no content it will have no width/height and collapse.

Unfortunately, the only way to call IRegionNavigationJournal.GoBack() would be from the IRegion, since implementing INavigationAware on the empty UserControl doesn't really help (Unless you add UI elements or events that can call IRegionNavigationJournal.GoBack())

enter image description here