PRISM Navigation at start up fails

steve fred 1 Reputation point
2021-10-27T18:57:34.53+00:00

I am not sure this where to ask this question
I am using PRISM 8.0 cire
At startup I try to navigate to a view to a region and it fails.
I the navigation right after the InitializeComponent method

public partial class MainWindow : ThemedWindow
{
    public MainWindow()
    {
        InitializeComponent();
        var mv = DataContext as MainWindowViewModel;
        mv.NavigateToToolbar();
        ;
    }

public void NavigateToToolbar()
{
_regionManager.RequestNavigate(RegionNames.NavigationBarRegion, "ToolbarWindow", NavigationCompleted);
}

    private void NavigationCompleted(NavigationResult result)
    {
        var a = 1;
    }

Can anyone tell me why this would fail?
The ToolbarWindow is registered for navigation with the container

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,647 questions
{count} votes