UI.WPF.Modern icon indicating copy to clipboard operation
UI.WPF.Modern copied to clipboard

Large empty space below `NavigationView.PaneFooter`

Open 66BA9Q-ME49 opened this issue 4 months ago • 0 comments

Describe the bug

There is a large empty space below the PaneFooter of the NavigationView element:

Image
XAML Code
<Window x:Class="WPFApp.Test"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:local="clr-namespace:WPFApp"
      xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
      xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
      mc:Ignorable="d"
      
      ui:WindowHelper.UseModernWindowStyle="True"
      ui:WindowHelper.SystemBackdropType="Mica"
      ui:TitleBar.IsIconVisible="True"
      
      Title="Test" Height="550" Width="950" Background="#101010" Loaded="Window_Loaded">
  <Grid>
      <ui:NavigationView
          ExpandedModeThresholdWidth="500"
          PaneTitle="NavigationView"
          IsBackEnabled="False"
          IsBackButtonVisible="Collapsed"
          IsTabStop="False"
          IsSettingsVisible="False"
          PaneDisplayMode="Auto">

          <!-- Menu Items -->
          <ui:NavigationView.MenuItems>
              <ui:NavigationViewItem
                      x:Name="SamplePage1Item"
                      Content="Menu Item1"
                      Tag="SamplePage1">
                  <ui:NavigationViewItem.Icon>
                      <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Play}" />
                  </ui:NavigationViewItem.Icon>
              </ui:NavigationViewItem>
          </ui:NavigationView.MenuItems>

          <!-- Footer -->
          <ui:NavigationView.PaneFooter>
              <Grid Margin="20,0,20,0">
                  <!-- Button -->
                  <Button Grid.Column="0" HorizontalAlignment="Left" Style="{DynamicResource {x:Static ui:ThemeKeys.AccentButtonStyleKey}}" Content="Button" />

                  <!-- Settings -->
                  <Button Style="{StaticResource TransparentButton}" Grid.Column="1" HorizontalAlignment="Right" Width="40" Height="40">
                      <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
                  </Button>
              </Grid>
          </ui:NavigationView.PaneFooter>

          <ui:Frame x:Name="Frame_Main"/>
      </ui:NavigationView>
  </Grid>
</Window>

The buttons I put inside the NavigationView.PaneFooter element should be positioned at the bottom of the NavigationView because IsSettingsVisible is False and NavigationView.FooterMenuItems is empty.

Reproduction

Use the code above, or:

  1. Open the gallery
  2. Go to the NavigationView page
  3. Scroll down to the "API in action" section
  4. Check the PaneFooter visible checkbox

Suggested Solution

  1. Remove the MinHeight property assignation https://github.com/iNKORE-NET/UI.WPF.Modern/blob/e71bed9b67090ee4ccddd019e68100296f84770f/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/NavigationView/NavigationView.xaml#L1165-L1168 Replace with:
 <RowDefinition 
     x:Name="FooterItemsRow" 
     Height="Auto" /> 
  1. Set the VerticalScrollBarVisibility property of the ScrollViewerEx to Auto https://github.com/iNKORE-NET/UI.WPF.Modern/blob/e71bed9b67090ee4ccddd019e68100296f84770f/source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/NavigationView/NavigationView.xaml#L1203-L1206 Replace with:
<ui:ScrollViewerEx x:Name="FooterItemsScrollViewer" VerticalScrollBarVisibility="Auto">
     <!--  contract7Present:VerticalAnchorRatio="1"  -->
     <local:ItemsRepeater x:Name="FooterMenuItemsHost" />
</ui:ScrollViewerEx>

Library Version

0.10.1

Operating System

Windows 11

Framework

.NET Core and .NET

Framework Version

9

Source of Package

NuGet.org (Package)

Additional Notes

No response

Validations

  • [x] Check that there isn't already an issue that reports the same or similar problem.
  • [x] Check that this is a bug in the library that should be fixed, not a feature, also this is not about the documentation. (Or please choose the right repo and template.)
  • [x] This is one single problem, or a few problems with the same cause. (If you want to report multiple problems, please create one issue for every single problem.)
  • [x] You've checked that this problem still exists in the latest version. (Keep in mind that we don't provide any support for old versions.)
  • [x] You know that we can't guarantee that we will satisfy your request. This is not really our duty to do everything anyone asks for. Also, you will treat our staff, contributors, and other users with respect and kindness.
  • [x] You're sure there's something wrong with the library itself, not how you're using it. (If you are having issues using it and need help, please go to discussion.)

Discussed in https://github.com/iNKORE-NET/UI.WPF.Modern/discussions/333

66BA9Q-ME49 avatar Aug 20 '25 02:08 66BA9Q-ME49