Disabling EdgeNavigator for certain page

I want to disable Sidebar page on LoginPage.ux becasue at that state I don’t need it. However, I need the Sidebar page on DashboardPage.ux. I did try with whiletrue but keeps throwing me an error.
This is my MainView.ux page

<EdgeNavigator ux:Name="EdgeNav" HitTestMode="LocalBoundsAndChildren" Opacity="1">
<Sidebar EdgeNavigation.Edge="Left" >


   <Navigator DefaultPath="LoginPage">
<LoginPage ux:Template="LoginPage" router="router" />
<DashboardPage ux:Template="DashboardPage" router="router" />

The approach to solving this usually is simply putting the pages that don’t need a sidebar in a parent that does not have one. The structure then is something like this:

<Navigator DefaultPath="pagesWithEdge">
    <PagesWithEdge ux:Template="pagesWithEdge" />
    <PagesWithoutEdge ux:Template="pagesWithoutEdge" />

<Panel ux:Class="PagesWithEdge">
        <Sidebar />
        <Navigator DefaultPath="somePage">
            <SomePage ux:Template="somePage" />

<!-- ... -->

This does add another level of depth to your navigation calls, but that’s about the only inconvenience:

router.push("pagesWithEdge", {}, "somePage", {});

Hope this helps!

I hope this answer isn’t too late.

If you want to disable Sidebar page on Somepage, then insert this code in Somepage.

    <Change EdgeNavigator.IsEnabled="false" />