Skip to content

How to disable NavigationView content scrollbar #1606

@Mr-Glin

Description

@Mr-Glin

Describe the bug

How can I disable the scrollbar that appears when displaying a NavigationViewItem when using NavigationView?

To Reproduce

    <ui:NavigationView
        x:Name="RootNavigation"
        Grid.Row="1"
        BorderBrush="Transparent"
        BorderThickness="1"
        Loaded="NavigationView_Loaded"
        PaneDisplayMode="LeftFluent">

        <ui:NavigationView.MenuItems>
            <ui:NavigationViewItem TargetPageType="{x:Type views:HomePage}">
                <ui:NavigationViewItem.Icon>
                    <ui:SymbolIcon Symbol="Home24" />
                </ui:NavigationViewItem.Icon>
            </ui:NavigationViewItem>
        </ui:NavigationView.MenuItems>
    </ui:NavigationView>

<Grid>
    <StackPanel
        MaxHeight="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=Window}}"
        HorizontalAlignment="Center"
        VerticalAlignment="Center">
        <ui:TextBlock
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            FontSize="24"
            Foreground="Black"
            Text="Text&gt;&gt;&gt;" />
        <ui:TextBlock
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            FontSize="24"
            Foreground="Black"
            Text="Text&gt;&gt;&gt;" />

       ...... more TextBlock

    </StackPanel>

</Grid>

Expected behavior

The navigationview's scrollbar has disappeared. I can control whether a portion of the scrollbar is displayed within the page.

Screenshots

Image

OS version

Windows11

.NET version

.net 8

WPF-UI NuGet version

4.1.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions