Reputation: 23
I'm using Xamarin Forms 3.6. I want to hide the back button in the UWP app. In the UWP App.xaml.cs OnLaunced I've added.
SystemNavigationManager
.GetForCurrentView()
.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
I've also added it to each ContentPage (using dependency injection) so that in the constructor of each page runs the above code.
Each content page, I've also added:
NavigationPage.SetHasNavigationBar(this, false);
I always still seem to get the back button in the title bar on UWP. Any ideas in Xamarin Forms UWP how to hide and keep hidden the back button?
Upvotes: 0
Views: 126
Reputation: 32775
For your requirement, please invoke SetHasBackButton
static method in the page where you want to hide back button like the following.
public ItemDetailPage(ItemDetailViewModel viewModel)
{
InitializeComponent();
NavigationPage.SetHasBackButton(this, false);
BindingContext = this.viewModel = viewModel;
}
Upvotes: 1