Hello @Alberto Herrera Welcome to Microsoft Q&A,
[Xamarin.Forms][Shell][XAML] Remove Shell Flyout Hamburguer Button WITHOUT disabling Flyout
For your requirement, you could find shellrender style here, if you just want to disable hamburger menu button, you could find TogglePaneButton and set it Visibility="Collapsed"
. Then copy all the style content to UWP App.xaml file like the following
<Application
x:Class="Xaminals.UWP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:contract4Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,4)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:local="using:Xaminals.UWP"
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
xmlns:xf="using:Xamarin.Forms.Platform.UWP">
<Application.Resources>
<ResourceDictionary>
<DataTemplate x:Key="ShellFlyoutBaseShellItemTemplate">
<winui:NavigationViewItem x:Name="navItem">
<xf:ShellFlyoutItemRenderer IsSelected="{Binding IsSelected, ElementName=navItem, Mode=TwoWay}"></xf:ShellFlyoutItemRenderer>
</winui:NavigationViewItem>
</DataTemplate>
<DataTemplate x:Key="ShellFlyoutMenuItemTemplate">
<winui:NavigationViewItem x:Name="navItem">
<xf:ShellFlyoutItemRenderer IsSelected="{Binding IsSelected, ElementName=navItem, Mode=TwoWay}"></xf:ShellFlyoutItemRenderer>
</winui:NavigationViewItem>
</DataTemplate>
<DataTemplate x:Key="ShellFlyoutSeperatorTemplate">
<winui:NavigationViewItemSeparator />
</DataTemplate>
<DataTemplate x:Key="ShellSectionMenuItemTemplate">
<winui:NavigationViewItem Content="{Binding Title}"/>
</DataTemplate>
<ItemsPanelTemplate x:Key="ShellToolbarItemsPanelTemplate">
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
<DataTemplate x:Key="ShellToolbarItemTemplate">
<xf:ShellToolbarItemRenderer ToolbarItem="{Binding}" Margin="0" Background="Transparent" BorderThickness="1" IsEnabled="{Binding IsEnabled}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image
DataContext="{Binding IconImageSource, Converter={StaticResource ImageConverter}}" Source="{Binding Value}" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Foreground="White" VerticalAlignment="Center" Text="{Binding Text}"></TextBlock>
</Grid>
</xf:ShellToolbarItemRenderer>
</DataTemplate>
<Style x:Key="ShellNavigationView" TargetType="xf:ShellRenderer">
........
And above style will hidden Hamburguer button, but allow backbutton work.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.