Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
df185e4
PoC for hijacking RequestBringIntoView event
nicolaihenriksen Dec 9, 2025
8f02def
Improves tab header scrolling behavior
nicolaihenriksen Dec 9, 2025
0511117
Adding smooth/animated scrolling to the behavior
nicolaihenriksen Dec 9, 2025
721a25c
Ensure padding on tab headers is only applied when they overflow
nicolaihenriksen Dec 9, 2025
f631a2d
Adding UI tests without assertions to easily test behavior
nicolaihenriksen Dec 10, 2025
9cace11
Minor hack! Prevent double-click on tab (control) while animating
nicolaihenriksen Dec 10, 2025
7c0c9ee
Add TabAssist.AnimateTabScrolling to toggle tab switch animation feature
nicolaihenriksen Dec 10, 2025
c27cc43
Add TODO comment regarding destructive-read on TabScrollDirection AP
nicolaihenriksen Dec 10, 2025
d18d4d4
Add TabAssist.TabScrollOffset to give control of the offset
nicolaihenriksen Dec 10, 2025
4a960c0
Replace TabAssist.AnimateTabScrolling with TabAssist.TabScrollDuration
nicolaihenriksen Dec 10, 2025
9631e7a
Rename hijacking StackPanel
nicolaihenriksen Dec 14, 2025
f001a07
Rename TabScrollDirection
nicolaihenriksen Dec 14, 2025
737223f
Rename TabScrollOffset
nicolaihenriksen Dec 14, 2025
eb5d42d
Rename TabScrollDuration
nicolaihenriksen Dec 14, 2025
966c1e8
Remove debug output
nicolaihenriksen Dec 14, 2025
a604ccf
Add TabAssist.UseHeaderPadding to enable/disable new behavior
nicolaihenriksen Dec 14, 2025
0200ded
Change bring into view event listener to class handler
nicolaihenriksen Dec 21, 2025
a4512b4
Implement "destructive read" of TabScrollDirection
nicolaihenriksen Dec 21, 2025
eca4a48
Mitigate quick keypresses causing tab animation to stop
nicolaihenriksen Dec 21, 2025
fe5b943
Use tab animation even when tab has focusable content
nicolaihenriksen Dec 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
PoC for hijacking RequestBringIntoView event
  • Loading branch information
nicolaihenriksen committed Dec 9, 2025
commit df185e4a88295509f4bfa61752daeebca2093ae6
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

namespace MaterialDesignThemes.Wpf.Internal;

public class BringIntoViewHijackingVirtualizingStackPanel : VirtualizingStackPanel
{
public BringIntoViewHijackingVirtualizingStackPanel()
=> AddHandler(FrameworkElement.RequestBringIntoViewEvent, new RoutedEventHandler(OnRequestBringIntoView), false);

private void OnRequestBringIntoView(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is FrameworkElement child && child != this)
{
e.Handled = true;
var point = child.TranslatePoint(new Point(), this);
var newTargetRect = new Rect(new Point(point.X + 52, point.Y), child.RenderSize);
BringIntoView(newTargetRect);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters"
xmlns:internal="clr-namespace:MaterialDesignThemes.Wpf.Internal"
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf">

<ResourceDictionary.MergedDictionaries>
Expand Down Expand Up @@ -45,7 +46,7 @@
Focusable="False"
KeyboardNavigation.TabIndex="1"
Rows="1" />
<VirtualizingStackPanel x:Name="HeaderPanel"
<internal:BringIntoViewHijackingVirtualizingStackPanel x:Name="HeaderPanel"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{Binding Path=(wpf:TabAssist.HeaderPanelMargin), RelativeSource={RelativeSource TemplatedParent}}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Expand Down