Skip to content

Commit 3d6715a

Browse files
authored
Fix: Fixed issue where details layout headers weren't always "sticky" (#14262)
1 parent 4c46fc0 commit 3d6715a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Files.App/Data/Behaviors/StickyHeaderBehavior.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ public class StickyHeaderBehavior : BehaviorBase<FrameworkElement>
3636

3737
private InsetClip? _contentClip;
3838

39+
private readonly DispatcherTimer _assignAnimationTimer;
40+
41+
public StickyHeaderBehavior()
42+
{
43+
_assignAnimationTimer = new();
44+
_assignAnimationTimer.Interval = TimeSpan.FromMilliseconds(200);
45+
_assignAnimationTimer.Tick += (sender, e) =>
46+
{
47+
AssignAnimation();
48+
_assignAnimationTimer.Stop();
49+
};
50+
}
51+
3952
/// <summary>
4053
/// The UIElement that will be faded.
4154
/// </summary>
@@ -92,7 +105,9 @@ protected override bool Uninitialize()
92105
private static void PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
93106
{
94107
var b = d as StickyHeaderBehavior;
95-
b?.AssignAnimation();
108+
109+
// For some reason, the assignment needs to be delayed. (#14237)
110+
b?._assignAnimationTimer.Start();
96111
}
97112

98113
/// <summary>

0 commit comments

Comments
 (0)