Skip to content
Open
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
Prev Previous commit
Next Next commit
Remove debug output
  • Loading branch information
nicolaihenriksen committed Dec 14, 2025
commit 966c1e87cc1d5c2c19fe8ffb357d39039d4d93ed
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ protected override void OnDetaching()

private void AssociatedObject_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
Debug.WriteLine($"ContentHorizontalOffset: {AssociatedObject.ContentHorizontalOffset}, HorizontalOffset: {e.HorizontalOffset}, HorizontalChange: {e.HorizontalChange}, ViewportWidth: {e.ViewportWidth}, ExtentWidth: {e.ExtentWidth}");
TimeSpan duration = TabAssist.GetScrollDuration(TabControl);
if (duration == TimeSpan.Zero)
return;
Expand All @@ -137,19 +136,16 @@ private void AssociatedObject_ScrollChanged(object sender, ScrollChangedEventArg

double originalValue = desiredOffsetStart;
double newValue = e.HorizontalOffset;

_isAnimatingScroll = true;

// HACK: Temporarily disable user interaction while the animated scroll is ongoing. This prevents the double-click of a tab stopping the animation prematurely.
bool originalIsHitTestVisibleValue = TabControl.IsHitTestVisible;
TabControl.SetCurrentValue(FrameworkElement.IsHitTestVisibleProperty, false);

AssociatedObject.ScrollToHorizontalOffset(originalValue);
Debug.WriteLine($"Initiating animated scroll from {originalValue} to {newValue}. Change is: {e.HorizontalChange}");
DoubleAnimation scrollAnimation = new(originalValue, newValue, new Duration(duration));
scrollAnimation.Completed += (_, _) =>
{
Debug.WriteLine("Animation completed");
_desiredScrollStart = null;
_isAnimatingScroll = false;

Expand Down