How can I navigate the blazor pages with the press of a xaml button?

Mark Wiesemann 0 Reputation points
2023-01-12T21:41:58.3+00:00

So here is my generally idea:

I have a flyout page in which i want to press different buttons to load different blazor pages in the flyout.details. the goal is to replace the default navbar of the blazor example with native elements of the different frameworks. My first thought was accessing the navigationManager of the blazor pages but no idea how. Does that even makes sense? I feel like I am missing sth very crucial because it seems to be a very natural thing to do with .net Maui Blazor.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
902 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
795 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 11,461 Reputation points Microsoft Employee
    2023-01-13T02:47:23.39+00:00

    Hello,

    You could not load different blazor pages in the flyoutPage by pressing different buttons, because Blazor pages are not the MAUI ContenPage class. An alternative implementation is to load a ContenPage containing a different blazor page in the FlyoutPage by pressing a different button.

    These two navigation methods cannot be mixed, MAUI navigation only acts on MAUI's Page classes, Blazor is the same.

    You could refer to the following two documentations to get more detailed information about the navigation methods on Blazor:

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our [documentation][1] to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments