Skip to content

Commit 6252303

Browse files
authored
Revert "Revert "πŸ› pin footer menu items to prevent scrolling (#1431)" (#1435)" (#1436)
This reverts commit 73ce9a3.
1 parent 73ce9a3 commit 6252303

File tree

3 files changed

+80
-45
lines changed

3 files changed

+80
-45
lines changed

β€Žsrc/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xamlβ€Ž

Lines changed: 64 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,14 @@
288288
<Border x:Name="PaneBorder">
289289
<Grid>
290290
<Grid.RowDefinitions>
291+
<RowDefinition Height="Auto" />
291292
<RowDefinition Height="Auto" />
292293
<RowDefinition Height="*" />
293294
<RowDefinition Height="Auto" />
295+
<RowDefinition Height="Auto" />
294296
</Grid.RowDefinitions>
295297

296-
<!-- Back and Toggle buttons -->
298+
<!-- Pane Header (Fixed) -->
297299
<Grid Grid.Row="0">
298300
<Grid.RowDefinitions>
299301
<RowDefinition Height="Auto" />
@@ -331,7 +333,7 @@
331333
</controls:Button.Content>
332334
</controls:Button>
333335

334-
<!-- Pane header -->
336+
<!-- Pane Header -->
335337
<ContentPresenter
336338
Grid.Row="2"
337339
Margin="0"
@@ -341,7 +343,7 @@
341343
<ContentPresenter
342344
x:Name="AutoSuggestBoxContentPresenter"
343345
Grid.Row="3"
344-
Margin="0"
346+
Margin="0,0,0,6"
345347
Content="{TemplateBinding AutoSuggestBox}" />
346348

347349
<controls:Button
@@ -353,57 +355,74 @@
353355
Visibility="Collapsed" />
354356
</Grid>
355357

356-
<!-- Menu items -->
357-
<controls:DynamicScrollViewer
358+
<!-- Separator/Shadow for Top -->
359+
<Border
358360
Grid.Row="1"
361+
Height="1"
362+
Margin="0,4,0,4"
363+
Background="{DynamicResource LeftNavigationViewSeparatorBrush}" />
364+
365+
<!-- Scrollable Menu Items -->
366+
<controls:DynamicScrollViewer
367+
x:Name="PART_ScrollViewer"
368+
Grid.Row="2"
359369
Margin="0,0,-4,0"
360370
Padding="0,0,4,0"
361371
CanContentScroll="True"
362372
HorizontalScrollBarVisibility="Disabled"
363373
VerticalScrollBarVisibility="Auto">
364-
<Grid>
365-
<Grid.RowDefinitions>
366-
<RowDefinition Height="*" />
367-
<RowDefinition Height="Auto" />
368-
</Grid.RowDefinitions>
369-
<ItemsControl
370-
x:Name="PART_MenuItemsItemsControl"
371-
Grid.Row="0"
372-
Focusable="False"
373-
KeyboardNavigation.DirectionalNavigation="Contained"
374-
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
375-
ScrollViewer.VerticalScrollBarVisibility="Disabled">
376-
<ItemsControl.ItemsPanel>
377-
<ItemsPanelTemplate>
378-
<StackPanel Margin="0" IsItemsHost="True" />
379-
</ItemsPanelTemplate>
380-
</ItemsControl.ItemsPanel>
381-
</ItemsControl>
382-
<ItemsControl
383-
x:Name="PART_FooterMenuItemsItemsControl"
384-
Grid.Row="1"
385-
Margin="0,0,0,4"
386-
Focusable="False"
387-
KeyboardNavigation.DirectionalNavigation="Contained"
388-
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
389-
ScrollViewer.VerticalScrollBarVisibility="Disabled">
390-
<ItemsControl.ItemsPanel>
391-
<ItemsPanelTemplate>
392-
<StackPanel Margin="0" IsItemsHost="True" />
393-
</ItemsPanelTemplate>
394-
</ItemsControl.ItemsPanel>
395-
</ItemsControl>
396-
</Grid>
374+
<ItemsControl
375+
x:Name="PART_MenuItemsItemsControl"
376+
Focusable="False"
377+
KeyboardNavigation.DirectionalNavigation="Contained"
378+
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
379+
ScrollViewer.VerticalScrollBarVisibility="Disabled">
380+
<ItemsControl.ItemsPanel>
381+
<ItemsPanelTemplate>
382+
<StackPanel Margin="0" IsItemsHost="True" />
383+
</ItemsPanelTemplate>
384+
</ItemsControl.ItemsPanel>
385+
</ItemsControl>
397386
</controls:DynamicScrollViewer>
398387

399-
<!-- Pane footer -->
400-
<ContentPresenter
401-
Grid.Row="2"
402-
Margin="0"
403-
Content="{TemplateBinding PaneFooter}" />
388+
<!-- Separator/Shadow for Footer -->
389+
<Border
390+
Grid.Row="3"
391+
Height="1"
392+
Margin="0,4,0,4"
393+
Background="{DynamicResource LeftNavigationViewSeparatorBrush}" />
394+
395+
<!-- Footer (Fixed) -->
396+
<Grid Grid.Row="4">
397+
<Grid.RowDefinitions>
398+
<RowDefinition Height="Auto" />
399+
<RowDefinition Height="Auto" />
400+
</Grid.RowDefinitions>
401+
402+
<ItemsControl
403+
x:Name="PART_FooterMenuItemsItemsControl"
404+
Grid.Row="0"
405+
Margin="0,0,0,4"
406+
Focusable="False"
407+
KeyboardNavigation.DirectionalNavigation="Contained"
408+
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
409+
ScrollViewer.VerticalScrollBarVisibility="Disabled">
410+
<ItemsControl.ItemsPanel>
411+
<ItemsPanelTemplate>
412+
<StackPanel Margin="0" IsItemsHost="True" />
413+
</ItemsPanelTemplate>
414+
</ItemsControl.ItemsPanel>
415+
</ItemsControl>
416+
417+
<ContentPresenter
418+
Grid.Row="1"
419+
Margin="0"
420+
Content="{TemplateBinding PaneFooter}" />
421+
</Grid>
404422
</Grid>
405423
</Border>
406424
</Grid>
425+
407426
<Border
408427
Grid.Column="1"
409428
Margin="{TemplateBinding FrameMargin}"
@@ -417,7 +436,7 @@
417436
<RowDefinition Height="*" />
418437
</Grid.RowDefinitions>
419438

420-
<!-- Header -->
439+
<!-- Header (e.g., BreadcrumbBar) -->
421440
<ContentPresenter
422441
Grid.Row="0"
423442
Margin="0"
@@ -432,7 +451,7 @@
432451
Transition="{TemplateBinding Transition}"
433452
TransitionDuration="{TemplateBinding TransitionDuration}" />
434453

435-
<!-- Overlay -->
454+
<!-- Overlay (e.g., SnackbarPresenter) -->
436455
<ContentPresenter
437456
Grid.Row="0"
438457
Grid.RowSpan="2"

β€Žsrc/Wpf.Ui/Resources/Theme/Dark.xamlβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,4 +681,12 @@
681681
<SolidColorBrush x:Key="TreeViewItemBackgroundSelected" Color="{StaticResource SubtleFillColorSecondary}" />
682682
<SolidColorBrush x:Key="TreeViewItemForeground" Color="{StaticResource TextFillColorPrimary}" />
683683
<SolidColorBrush x:Key="TreeViewItemSelectionIndicatorForeground" Color="{DynamicResource SystemAccentColorPrimary}" />
684+
685+
<!-- LeftNavigationViewTemplate -->
686+
<LinearGradientBrush x:Key="LeftNavigationViewSeparatorBrush" StartPoint="0,0" EndPoint="1,0">
687+
<GradientStop Offset="0" Color="Transparent" />
688+
<GradientStop Offset="0.3" Color="#555555" />
689+
<GradientStop Offset="0.7" Color="#555555" />
690+
<GradientStop Offset="1" Color="Transparent" />
691+
</LinearGradientBrush>
684692
</ResourceDictionary>

β€Žsrc/Wpf.Ui/Resources/Theme/Light.xamlβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,4 +682,12 @@
682682
<SolidColorBrush x:Key="TreeViewItemBackgroundSelected" Color="{StaticResource SubtleFillColorSecondary}" />
683683
<SolidColorBrush x:Key="TreeViewItemForeground" Color="{StaticResource TextFillColorPrimary}" />
684684
<SolidColorBrush x:Key="TreeViewItemSelectionIndicatorForeground" Color="{DynamicResource SystemAccentColorPrimary}" />
685+
686+
<!-- LeftNavigationViewTemplate -->
687+
<LinearGradientBrush x:Key="LeftNavigationViewSeparatorBrush" StartPoint="0,0" EndPoint="1,0">
688+
<GradientStop Offset="0" Color="#F5F5F5" />
689+
<GradientStop Offset="0.3" Color="#E0E0E0" />
690+
<GradientStop Offset="0.7" Color="#E0E0E0" />
691+
<GradientStop Offset="1" Color="#FAFAFA" />
692+
</LinearGradientBrush>
685693
</ResourceDictionary>

0 commit comments

Comments
Β (0)