Skip to content

NavigationView - Changing CompactPaneLength the Hamburger menu still visible #20199

Closed

Description

@rafael-rosa-knowcode

Current behavior

When change the NavigationView CompactPaneLength the Hamburger Menu still visible.

NavigationView.hamburger.menu.mp4

Expected behavior

When change the CompactPaneLength the menu hide as the others.

How to reproduce it (as minimally and precisely as possible)

Use the sample project

UnoApp7.zip

Or create a new app with toolkit

dotnet new unoapp -o UnoApp7 -toolkit -pub "UnoApp7"

Update the the current last version "Uno.Sdk": "6.1.0-dev.91" on global.json
Change the SkiaHostBuilder to UnoPlatformHostBuilder on the Program.cs

Change the MainPage.xaml content.

<Page x:Class="UnoApp7.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:UnoApp7"
      xmlns:utu="using:Uno.Toolkit.UI"
      Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <ScrollViewer>
        <Grid utu:SafeArea.Insets="VisibleBounds">
            <StackPanel HorizontalAlignment="Stretch"
                        VerticalAlignment="Center">

                <Grid RowDefinitions="50,*" ColumnDefinitions="50,*">
                    <TextBlock Text="{Binding Path=CompactPaneLength, ElementName=NavigationViewName}"/>
                    <Button Content="Increase 100 on CompactPaneLength"
                            Click="IncreaseValueOnCompactPaneLength_Click"
                            Grid.Column="1"/>

                    <TextBlock Grid.Row="1"
                               Text="{Binding Path=OpenPaneLength, ElementName=NavigationViewName}"/>
                    <Button Grid.Row="1"
                            Grid.Column="1"
                            Content="Increase 100 on OpenPaneLength"
                            Click="IncreaseValueOnOpenPaneLength_Click"/>

                </Grid>

                <NavigationView x:Name="NavigationViewName"
                                Background="Green"
                                CompactPaneLength="200"
                                OpenPaneLength="100"
                                IsPaneOpen="True"
                                HorizontalAlignment="Stretch">

                    <NavigationView.MenuItems>
                        <NavigationViewItem Content="Menu">
                            <NavigationViewItem.Icon>
                                <SymbolIcon Symbol="AddFriend" />
                            </NavigationViewItem.Icon>
                        </NavigationViewItem>

                        <NavigationViewItem Content="Settings">
                            <NavigationViewItem.Icon>
                                <SymbolIcon Symbol="Setting" />
                            </NavigationViewItem.Icon>
                        </NavigationViewItem>
                    </NavigationView.MenuItems>

                    <NavigationView.Content>
                        <Grid Background="Red">
                            <TextBlock Text="Main content area!"
                               FontSize="24"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Center"/>
                        </Grid>
                    </NavigationView.Content>
                </NavigationView>

            </StackPanel>
        </Grid>
    </ScrollViewer>
</Page>

and add to the MainPage.xaml.cs

    private void IncreaseValueOnCompactPaneLength_Click(object sender, RoutedEventArgs e)
    {
#if !WINDOWS
        NavigationViewName.CompactPaneLength = NavigationViewName.CompactPaneLength + 100;
#endif
    }

    private void IncreaseValueOnOpenPaneLength_Click(object sender, RoutedEventArgs e)
    {
#if !WINDOWS
        NavigationViewName.OpenPaneLength = NavigationViewName.OpenPaneLength + 100;
        //NavigationViewName.SetValue(NavigationView.OpenPaneLengthProperty, NavigationViewName.OpenPaneLength + 100);
#endif
    }

Click to Increase 100 on CompactPaneLength several times

Nuget Package: "6.1.0-dev.91"

Package Version(s):

Affected platform(s):

  • WebAssembly
  • Android
  • iOS
  • macOS (AppKit)
  • Mac Catalyst
  • Skia
    • WPF
    • GTK (Linux)
    • Linux Framebuffer
    • Tizen
  • Windows

IDE:

  • Visual Studio 2022
  • Visual Studio 2019
  • Visual Studio Code
  • Visual Studio for Mac
  • Rider Windows
  • Rider macOS

Relevant plugins:

Anything else we need to know?

Activity

  1. added
    kind/bug
    triage/untriaged
    on May 6, 2025
  2. added
    area/navigationview 🧭
    on May 6, 2025
  3. self-assigned this
    on Jul 1, 2025
  4. added theissue type on Jul 15, 2025
  5. changed the title [-]NavigationView - Changing CompactPaneLength the Hamburger menu still visible[/-] [+]`NavigationView` - Changing `CompactPaneLength` the Hamburger menu still visible[/+] on Oct 16, 2025
  6. added
    project/navigation-lifecycle 🧬
    and removed
    triage/untriaged
    on Oct 16, 2025
  7. github-actions commented on May 12, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  8. added
    stale
    on May 12, 2026
  9. removed
    stale
    on May 12, 2026
  10. MartinZikmund commented on Jun 12, 2026

    @MartinZikmund
    Member

    Verified as already resolved on current master: the CompactPaneLength → TemplateSettings.PaneToggleButtonWidth/SmallerPaneToggleButtonWidth → toggle-button chain now updates per WinUI behavior. A runtime test reproducing this scenario passes both at the current dev branch HEAD and at the base of #21132 (i.e. the fix landed earlier on master, before the NavigationView alignment work).

    A regression-guard runtime test (When_CompactPaneLength_Changed_PaneToggleButton_Updates) is included in #21132.

    If the originally reported scenario still misbehaves for you on a current build, please comment with an updated repro and we will reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/navigationview 🧭kind/bugproject/navigation-lifecycle 🧬

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions