Hide back button from NavViewEx(Template10.Extras.16299) UWP

311 Views Asked by At

I'm using a NavViewEx control of Template10.Extras.16299 in a UWP app, but with this i need to hide built in back button of NavViewEx control, because i already visible the AppViewBackButtonVisibility property, Now i have two back button in my application.

i.e.

enter image description here

Template10.Extras.16299 source: https://github.com/Windows-XAML/Template10/blob/master/Source/Template10.Extras.16299/Controls/NavViewEx.cs

Thanks.

1

There are 1 best solutions below

2
Nico Zhu On

hide built in back button of NavViewEx control

For hiding NavViewEx back button, you could modify the source code at line 138

_backButton = new Button
{
    Name = "BackButton",
    Content = new SymbolIcon
    {
        Symbol = Symbol.Back,
        IsHitTestVisible = false
    },
    Style = Resources["PaneToggleButtonStyle"] as Style,
    Visibility = Visibility.Collapsed,
};

You could also get BackButton with name by using visual tree helper then set Visibility as collapsed in NavViewEx loaded event.