File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ namespace Files
42
42
/// </summary>
43
43
public abstract class BaseLayout : Page , IBaseLayout , INotifyPropertyChanged
44
44
{
45
+ private readonly DispatcherTimer jumpTimer ;
46
+
45
47
protected NamedPipeAsAppServiceConnection Connection => ParentShellPageInstance ? . ServiceConnection ;
46
48
47
49
public SelectedItemsPropertiesViewModel SelectedItemsPropertiesViewModel { get ; }
@@ -132,9 +134,8 @@ public string JumpString
132
134
ScrollIntoView ( jumpedToItem ) ;
133
135
}
134
136
135
- // Reset
136
- jumpString = "" ;
137
- return ;
137
+ // Restart the timer
138
+ jumpTimer . Start ( ) ;
138
139
}
139
140
jumpString = value ;
140
141
}
@@ -208,6 +209,10 @@ internal set
208
209
209
210
public BaseLayout ( )
210
211
{
212
+ jumpTimer = new DispatcherTimer ( ) ;
213
+ jumpTimer . Interval = TimeSpan . FromSeconds ( 0.8 ) ;
214
+ jumpTimer . Tick += JumpTimer_Tick ; ;
215
+
211
216
SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel ( this ) ;
212
217
DirectoryPropertiesViewModel = new DirectoryPropertiesViewModel ( ) ;
213
218
@@ -223,6 +228,12 @@ public BaseLayout()
223
228
dragOverTimer = DispatcherQueue . GetForCurrentThread ( ) . CreateTimer ( ) ;
224
229
}
225
230
231
+ private void JumpTimer_Tick ( object sender , object e )
232
+ {
233
+ jumpString = string . Empty ;
234
+ jumpTimer . Stop ( ) ;
235
+ }
236
+
226
237
protected abstract void InitializeCommandsViewModel ( ) ;
227
238
228
239
public abstract void FocusFileList ( ) ;
You can’t perform that action at this time.
0 commit comments