0

I've been tasked with upgrading and rationalising a WPF project built using ModernUI. It references Prism but doesn't actually use it anywhere - almost all code is in code-behind files under the XAML.

This is not testable or maintainable, so I'm implementing viewmodels and working my way through using Prism properly. However, obviously I can't change the look too much and frankly, a visual redesign is not in scope for me, I'm not a graphic designer.

So we're fine, up until we get to navigation. I can't find any reference or even a hint on how to use mui's IContent alongside Prism's Regions.

Can anyone offer a clue?

EDIT:

I still can't seem to get Regions working and thus lose modularity, but I have discovered that I can do navigation in an MVVM way with mui.

If anyone's interested, both MenuLinkGroups and TitleLinks are dependency properties of ModernWindow so it's actually fairly easy to construct them in the viewmodel and bind like this in the Window declaration -

TitleLinks ="{Binding TitleLinks}"
MenuLinkGroups ="{Binding MenuLinkGroups}"

and in the viewmodel -

private LinkGroupCollection _menuLinkGroups = new LinkGroupCollection();

public LinkGroupCollection MenuLinkGroups
{
    get => _menuLinkGroups;
    set => SetProperty(ref _menuLinkGroups, value);
}
private LinkCollection _titleLinks = new LinkCollection();

public LinkCollection TitleLinks
{
    get => _titleLinks;
    set => SetProperty(ref _titleLinks, value);
}

I haven't tried this with UserControl yet but I'm fairly convinced it works the same way.

I would still value Regions and thus modules. Any help is appreciated.

Rich Bryant
  • 865
  • 10
  • 27

0 Answers0