Closed GioviQ closed 6 years ago
I have no experience with the MaterialDesign system you are trying to use. As that is a custom UI kit, I cannot officially support it. However, I can say that I guess that DialogHost is not part of the visual tree and therefore the region will not be created automatically. You will most likely have to attach the region manager in code-behind manually. That in addition to the fact that you didn't provide the required reproduction application, I am closing this issue.
@brianlagunas Apologies for bringing up this old issue but I am also having this problem and was hoping I can receive a pointer on how to workaround this issue. I'm unable to perform view injection because the region does not exist in IRegionManager.Regions.
@Jesus805 As I said in the previous post, you will have to attach the region manager in code-behind manually. Also, don't use the ServiceLocator. I don't know where you learned to set up your application like that, but it's not the correct way. Check out these samples: https://github.com/PrismLibrary/Prism-Samples-Wpf
@brianlagunas I'm not sure how to do that... is there a link to an example that I can look at? I'm still a noob at prism. Also, most of my setup code is from your pluralsight videos, which I moved from a bootstrapper.cs to App.cs in order to use the new PrismApplication. All of those Prism samples aren't using the new PrismApplication so I'm not sure how to properly set it up. I'm honestly not sure where I got that ServiceLocator line of code. ¯\_(ツ)_/¯ but I changed it, thanks.
It's just an attached property. It works like every attached property in WPF. Give your element a x:Name, and the use the attached property in code-behind.
I was able to get this to work. @GioviQ Refer to this page to register the DrawerHost Contents to the RegionManager. https://github.com/steve600/PrismMahAppsSample/wiki/Part-2:-Regions-and-RegionManager I'll also update my github repository with this solution.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I have a Prism WPF 6.3 application using a main menu copied from the following xaml https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/master/MainDemo.Wpf/MainWindow.xaml
I put a region in ListBox at line 47. The region works as expected (I see the registered views), but I cannot find it in region manager.
After some test I suspect the issue is because the region is nested in.
For example I have another region in ContentControl at line 88 and it is present in region manager.
Why region is not in region manager?