22
22
using Windows . UI . Xaml . Controls . Primitives ;
23
23
using Windows . UI . Xaml . Input ;
24
24
using Windows . UI . Xaml . Navigation ;
25
+ using Windows . ApplicationModel . Core ;
26
+ using Microsoft . Toolkit . Uwp . Helpers ;
25
27
26
28
namespace Files . Views . LayoutModes
27
29
{
@@ -292,7 +294,7 @@ private void ViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e
292
294
293
295
private TextBox renamingTextBox ;
294
296
295
- private void AllView_BeginningEdit ( object sender , DataGridBeginningEditEventArgs e )
297
+ private async void AllView_BeginningEdit ( object sender , DataGridBeginningEditEventArgs e )
296
298
{
297
299
if ( ParentShellPageInstance . FilesystemViewModel . WorkingDirectory . StartsWith ( AppSettings . RecycleBinPath ) )
298
300
{
@@ -317,13 +319,17 @@ private void AllView_BeginningEdit(object sender, DataGridBeginningEditEventArgs
317
319
{
318
320
// We have an edit due to the first tap in the double-click mode
319
321
// Let's wait to see if there is another tap (double click).
320
- tapDebounceTimer . Debounce ( ( ) =>
322
+
323
+ tapDebounceTimer . Debounce ( async ( ) =>
321
324
{
322
- tapDebounceTimer . Stop ( ) ;
325
+ await CoreApplication . MainView . DispatcherQueue . EnqueueAsync ( ( ) =>
326
+ {
327
+ tapDebounceTimer . Stop ( ) ;
323
328
324
- // EditingEventArgs will be null allowing us to know this edit is not originated by tap
325
- AllView . BeginEdit ( ) ;
329
+ AllView . BeginEdit ( ) ;
330
+ } ) ;
326
331
} , TimeSpan . FromMilliseconds ( 700 ) , false ) ;
332
+
327
333
}
328
334
}
329
335
else
0 commit comments