lepoco / lepoco/wpfui

How to disable NavigationView content scrollbar

Open
#1,606 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The reproduction uses NavigationView, NavigationViewItem, and a HomePage XAML view in WPF-UI 4.1.0. Start by reproducing the scrollbar behavior with the provided markup, then trace the NavigationView content presenter and related styling to identify the supported way to control it. Done means the navigation scrollbar is absent while page scrolling remains controllable.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.