Share via

navigationnView hamburger menu selected by default

Eduardo Gomez 3,571 Reputation points
Jun 27, 2023, 9:12 PM

My winUI 3 app, when I run it, the hamburger is selected by defoult, with a ugly white

<Window
    x:Class="Demy.View.NavWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
    xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <NavigationView
        Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
        IsBackButtonVisible="Collapsed"
        IsSettingsVisible="False"
        PaneDisplayMode="LeftCompact">
        <Interactivity:Interaction.Behaviors>
            <Core:EventTriggerBehavior EventName="SelectionChanged">
                <Core:EventTriggerBehavior.Actions>
                    <Core:InvokeCommandAction Command="{x:Bind ViewModel.NavigateToPageCommand}" />
                </Core:EventTriggerBehavior.Actions>
            </Core:EventTriggerBehavior>
        </Interactivity:Interaction.Behaviors>
        <NavigationView.MenuItems>
            <NavigationViewItem
                Content="Manage classroom"
                Tag="ManageClassPage">
                <NavigationViewItem.Icon>
                    <BitmapIcon UriSource="ms-appx:///Icons/classroom.png" />
                </NavigationViewItem.Icon>
            </NavigationViewItem>
            <NavigationViewItem
                Content="Create meeting"
                Tag="CreateMeetingPage">
                <NavigationViewItem.Icon>
                    <BitmapIcon UriSource="ms-appx:///Icons/meeting.png" />
                </NavigationViewItem.Icon>
            </NavigationViewItem>
            <NavigationViewItem
                Content="Join meeting"
                Tag="JoinMeetingPage">
                <NavigationViewItem.Icon>
                    <BitmapIcon UriSource="ms-appx:///Icons/join.png" />
                </NavigationViewItem.Icon>
            </NavigationViewItem>
            <NavigationViewItem
                Content="Report card"
                Tag="ReportCardPage">
                <NavigationViewItem.Icon>
                    <BitmapIcon UriSource="ms-appx:///Icons/report-card.png" />
                </NavigationViewItem.Icon>
            </NavigationViewItem>
            <NavigationViewItem
                Content="Schedule exam"
                Tag="ScheduleExamPage">
                <NavigationViewItem.Icon>
                    <BitmapIcon UriSource="ms-appx:///Icons/Schedule.png" />
                </NavigationViewItem.Icon>
            </NavigationViewItem>
            <NavigationViewItem
                Content="Subjects"
                Tag="SubjectPage">
                <NavigationViewItem.Icon>
                    <BitmapIcon UriSource="ms-appx:///Icons/school-subject.png" />
                </NavigationViewItem.Icon>
            </NavigationViewItem>
        </NavigationView.MenuItems>

        <Frame x:Name="NavFrame" />

    </NavigationView>
</Window>

User's image

code
https://github.com/eduardoagr/Demy-AI

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
856 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.