File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/Files.App/Data/Behaviors Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff 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>
You can’t perform that action at this time.
0 commit comments