diff --git a/src/Files.App/App.xaml.cs b/src/Files.App/App.xaml.cs index e7ec62d8ae24..3afb2b2a2527 100644 --- a/src/Files.App/App.xaml.cs +++ b/src/Files.App/App.xaml.cs @@ -264,7 +264,7 @@ private void EnsureSuperEarlyWindow() // Hook events for the window window.Activated += Window_Activated; - window.Closed += Window_ClosedAsync; + window.Closed += Window_Closed; // Attempt to activate it window.Activate(); @@ -294,7 +294,7 @@ public void OnActivated(AppActivationArguments activatedEventArgs) /// /// The source of the suspend request. /// Details about the suspend request. - private async void Window_ClosedAsync(object sender, WindowEventArgs args) + private async void Window_Closed(object sender, WindowEventArgs args) { // Save application state and stop any background activity diff --git a/src/Files.App/Data/Items/DriveItem.cs b/src/Files.App/Data/Items/DriveItem.cs index 6c448c38eb76..309020149080 100644 --- a/src/Files.App/Data/Items/DriveItem.cs +++ b/src/Files.App/Data/Items/DriveItem.cs @@ -214,12 +214,12 @@ public FrameworkElement? ItemDecorator Width = 16 } }; - itemDecorator.Click += ItemDecorator_ClickAsync; + itemDecorator.Click += ItemDecorator_Click; return itemDecorator; } } - private async void ItemDecorator_ClickAsync(object sender, RoutedEventArgs e) + private async void ItemDecorator_Click(object sender, RoutedEventArgs e) { var result = await DriveHelpers.EjectDeviceAsync(Path); await UIHelpers.ShowDeviceEjectResultAsync(Type, result); diff --git a/src/Files.App/Data/Models/DrivesViewModel.cs b/src/Files.App/Data/Models/DrivesViewModel.cs index 03192103f697..f0b341196b11 100644 --- a/src/Files.App/Data/Models/DrivesViewModel.cs +++ b/src/Files.App/Data/Models/DrivesViewModel.cs @@ -40,17 +40,17 @@ public DrivesViewModel(IRemovableDrivesService removableDrivesService, ISizeProv watcher = removableDrivesService.CreateWatcher(); watcher.DeviceAdded += Watcher_DeviceAdded; watcher.DeviceRemoved += Watcher_DeviceRemoved; - watcher.DeviceModified += Watcher_DeviceModifiedAsync; - watcher.EnumerationCompleted += Watcher_EnumerationCompletedAsync; + watcher.DeviceModified += Watcher_DeviceModified; + watcher.EnumerationCompleted += Watcher_EnumerationCompleted; } - private async void Watcher_EnumerationCompletedAsync(object? sender, System.EventArgs e) + private async void Watcher_EnumerationCompleted(object? sender, System.EventArgs e) { logger.LogDebug("Watcher_EnumerationCompleted"); await folderSizeProvider.CleanAsync(); } - private async void Watcher_DeviceModifiedAsync(object? sender, string e) + private async void Watcher_DeviceModified(object? sender, string e) { var matchingDriveEjected = Drives.FirstOrDefault(x => Path.GetFullPath(x.Path) == Path.GetFullPath(e)); if (matchingDriveEjected != null) @@ -68,7 +68,7 @@ private void Watcher_DeviceRemoved(object? sender, string e) } // Update the collection on the ui-thread. - Watcher_EnumerationCompletedAsync(null, EventArgs.Empty); + Watcher_EnumerationCompleted(null, EventArgs.Empty); } private void Watcher_DeviceAdded(object? sender, ILocatableFolder e) @@ -90,7 +90,7 @@ private void Watcher_DeviceAdded(object? sender, ILocatableFolder e) Drives.Add(e); } - Watcher_EnumerationCompletedAsync(null, EventArgs.Empty); + Watcher_EnumerationCompleted(null, EventArgs.Empty); } public async Task UpdateDrivesAsync() @@ -116,8 +116,8 @@ public void Dispose() watcher.Stop(); watcher.DeviceAdded -= Watcher_DeviceAdded; watcher.DeviceRemoved -= Watcher_DeviceRemoved; - watcher.DeviceModified -= Watcher_DeviceModifiedAsync; - watcher.EnumerationCompleted -= Watcher_EnumerationCompletedAsync; + watcher.DeviceModified -= Watcher_DeviceModified; + watcher.EnumerationCompleted -= Watcher_EnumerationCompleted; } } } diff --git a/src/Files.App/Data/Models/ItemViewModel.cs b/src/Files.App/Data/Models/ItemViewModel.cs index 8d8f8317a088..846a548607c5 100644 --- a/src/Files.App/Data/Models/ItemViewModel.cs +++ b/src/Files.App/Data/Models/ItemViewModel.cs @@ -431,10 +431,10 @@ public ItemViewModel(FolderSettingsViewModel folderSettingsViewModel) enumFolderSemaphore = new SemaphoreSlim(1, 1); dispatcherQueue = DispatcherQueue.GetForCurrentThread(); - UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEventAsync; - fileTagsSettingsService.OnSettingImportedEvent += FileTagsSettingsService_OnSettingUpdatedAsync; - fileTagsSettingsService.OnTagsUpdated += FileTagsSettingsService_OnSettingUpdatedAsync; - folderSizeProvider.SizeChanged += FolderSizeProvider_SizeChangedAsync; + UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEvent; + fileTagsSettingsService.OnSettingImportedEvent += FileTagsSettingsService_OnSettingUpdated; + fileTagsSettingsService.OnTagsUpdated += FileTagsSettingsService_OnSettingUpdated; + folderSizeProvider.SizeChanged += FolderSizeProvider_SizeChanged; RecycleBinManager.Default.RecycleBinItemCreated += RecycleBinItemCreatedAsync; RecycleBinManager.Default.RecycleBinItemDeleted += RecycleBinItemDeletedAsync; RecycleBinManager.Default.RecycleBinRefreshRequested += RecycleBinRefreshRequestedAsync; @@ -482,7 +482,7 @@ private async void RecycleBinItemCreatedAsync(object sender, FileSystemEventArgs await ApplySingleFileChangeAsync(newListedItem); } - private async void FolderSizeProvider_SizeChangedAsync(object? sender, SizeChangedEventArgs e) + private async void FolderSizeProvider_SizeChanged(object? sender, SizeChangedEventArgs e) { try { @@ -522,7 +522,7 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() => } } - private async void FileTagsSettingsService_OnSettingUpdatedAsync(object? sender, EventArgs e) + private async void FileTagsSettingsService_OnSettingUpdated(object? sender, EventArgs e) { await dispatcherQueue.EnqueueOrInvokeAsync(() => { @@ -531,7 +531,7 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() => }); } - private async void UserSettingsService_OnSettingChangedEventAsync(object? sender, SettingChangedEventArgs e) + private async void UserSettingsService_OnSettingChangedEvent(object? sender, SettingChangedEventArgs e) { switch (e.SettingName) { @@ -1792,14 +1792,14 @@ await Task.Factory.StartNew(() => if (rootFolder.AreQueryOptionsSupported(options)) { var itemQueryResult = rootFolder.CreateItemQueryWithOptions(options).ToStorageItemQueryResult(); - itemQueryResult.ContentsChanged += ItemQueryResult_ContentsChangedAsync; + itemQueryResult.ContentsChanged += ItemQueryResult_ContentsChanged; // Just get one item to start getting notifications var watchedItemsOperation = itemQueryResult.GetItemsAsync(0, 1); watcherCTS.Token.Register(() => { - itemQueryResult.ContentsChanged -= ItemQueryResult_ContentsChangedAsync; + itemQueryResult.ContentsChanged -= ItemQueryResult_ContentsChanged; watchedItemsOperation?.Cancel(); }); } @@ -1820,14 +1820,14 @@ private void WatchForWin32FolderChanges(string? folderPath) NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName }; - watcher.Created += DirectoryWatcher_ChangedAsync; - watcher.Deleted += DirectoryWatcher_ChangedAsync; - watcher.Renamed += DirectoryWatcher_ChangedAsync; + watcher.Created += DirectoryWatcher_Changed; + watcher.Deleted += DirectoryWatcher_Changed; + watcher.Renamed += DirectoryWatcher_Changed; watcher.EnableRaisingEvents = true; } } - private async void DirectoryWatcher_ChangedAsync(object sender, FileSystemEventArgs e) + private async void DirectoryWatcher_Changed(object sender, FileSystemEventArgs e) { Debug.WriteLine($"Directory watcher event: {e.ChangeType}, {e.FullPath}"); @@ -1837,7 +1837,7 @@ await dispatcherQueue.EnqueueOrInvokeAsync(() => }); } - private async void ItemQueryResult_ContentsChangedAsync(IStorageQueryResultBase sender, object args) + private async void ItemQueryResult_ContentsChanged(IStorageQueryResultBase sender, object args) { // Query options have to be reapplied otherwise old results are returned var options = new QueryOptions() @@ -2461,10 +2461,10 @@ public void Dispose() RecycleBinManager.Default.RecycleBinItemCreated -= RecycleBinItemCreatedAsync; RecycleBinManager.Default.RecycleBinItemDeleted -= RecycleBinItemDeletedAsync; RecycleBinManager.Default.RecycleBinRefreshRequested -= RecycleBinRefreshRequestedAsync; - UserSettingsService.OnSettingChangedEvent -= UserSettingsService_OnSettingChangedEventAsync; - fileTagsSettingsService.OnSettingImportedEvent -= FileTagsSettingsService_OnSettingUpdatedAsync; - fileTagsSettingsService.OnTagsUpdated -= FileTagsSettingsService_OnSettingUpdatedAsync; - folderSizeProvider.SizeChanged -= FolderSizeProvider_SizeChangedAsync; + UserSettingsService.OnSettingChangedEvent -= UserSettingsService_OnSettingChangedEvent; + fileTagsSettingsService.OnSettingImportedEvent -= FileTagsSettingsService_OnSettingUpdated; + fileTagsSettingsService.OnTagsUpdated -= FileTagsSettingsService_OnSettingUpdated; + folderSizeProvider.SizeChanged -= FolderSizeProvider_SizeChanged; DefaultIcons.Clear(); } } diff --git a/src/Files.App/Dialogs/AddItemDialog.xaml b/src/Files.App/Dialogs/AddItemDialog.xaml index aee00ba2d8cd..8f47a4ab9324 100644 --- a/src/Files.App/Dialogs/AddItemDialog.xaml +++ b/src/Files.App/Dialogs/AddItemDialog.xaml @@ -13,7 +13,7 @@ Grid.RowSpan="4" BorderThickness="0" CornerRadius="{StaticResource OverlayCornerRadius}" - Loaded="AddItemDialog_LoadedAsync" + Loaded="AddItemDialog_Loaded" RequestedTheme="{x:Bind helpers:ThemeHelper.RootTheme}" SecondaryButtonText="{helpers:ResourceString Name=Cancel}" Style="{StaticResource DefaultContentDialogStyle}" diff --git a/src/Files.App/Dialogs/AddItemDialog.xaml.cs b/src/Files.App/Dialogs/AddItemDialog.xaml.cs index d4c9166e5975..7bc71af5aa55 100644 --- a/src/Files.App/Dialogs/AddItemDialog.xaml.cs +++ b/src/Files.App/Dialogs/AddItemDialog.xaml.cs @@ -35,7 +35,7 @@ private void ListView_ItemClick(object sender, ItemClickEventArgs e) Hide(); } - private async void AddItemDialog_LoadedAsync(object sender, RoutedEventArgs e) + private async void AddItemDialog_Loaded(object sender, RoutedEventArgs e) { var itemTypes = addItemService.GetEntries(); await ViewModel.AddItemsToListAsync(itemTypes); diff --git a/src/Files.App/Helpers/ShareItemHelpers.cs b/src/Files.App/Helpers/ShareItemHelpers.cs index e378dafdce30..63ef8079b106 100644 --- a/src/Files.App/Helpers/ShareItemHelpers.cs +++ b/src/Files.App/Helpers/ShareItemHelpers.cs @@ -25,11 +25,11 @@ public static void ShareItems(IEnumerable itemsToShare) IntPtr result = interop.GetForWindow(MainWindow.Instance.WindowHandle, InteropHelpers.DataTransferManagerInteropIID); var manager = WinRT.MarshalInterface.FromAbi(result); - manager.DataRequested += new TypedEventHandler(Manager_DataRequestedAsync); + manager.DataRequested += new TypedEventHandler(Manager_DataRequested); interop.ShowShareUIForWindow(MainWindow.Instance.WindowHandle); - async void Manager_DataRequestedAsync(DataTransferManager sender, DataRequestedEventArgs args) + async void Manager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args) { DataRequestDeferral dataRequestDeferral = args.Request.GetDeferral(); List items = new(); diff --git a/src/Files.App/Helpers/UI/ThemeHelper.cs b/src/Files.App/Helpers/UI/ThemeHelper.cs index fc7f0ce74df8..646abd68098c 100644 --- a/src/Files.App/Helpers/UI/ThemeHelper.cs +++ b/src/Files.App/Helpers/UI/ThemeHelper.cs @@ -62,7 +62,7 @@ public static bool Initialize() // Registering to color changes, thus we notice when user changes theme system wide UiSettings = new UISettings(); - UiSettings.ColorValuesChanged += UiSettings_ColorValuesChangedAsync; + UiSettings.ColorValuesChanged += UiSettings_ColorValuesChanged; return true; } @@ -77,7 +77,7 @@ public static void ApplyResources() ApplyTheme(); } - private static async void UiSettings_ColorValuesChangedAsync(UISettings sender, object args) + private static async void UiSettings_ColorValuesChanged(UISettings sender, object args) { // Make sure we have a reference to our window so we dispatch a UI change if (currentApplicationWindow is null) diff --git a/src/Files.App/Services/UserSizeProvider.cs b/src/Files.App/Services/UserSizeProvider.cs index 8523f97d50c0..d3311f7ecc61 100644 --- a/src/Files.App/Services/UserSizeProvider.cs +++ b/src/Files.App/Services/UserSizeProvider.cs @@ -19,7 +19,7 @@ public UserSizeProvider() provider = GetProvider(); provider.SizeChanged += Provider_SizeChanged; - folderPreferences.PropertyChanged += FolderPreferences_PropertyChangedAsync; + folderPreferences.PropertyChanged += FolderPreferences_PropertyChanged; } public Task CleanAsync() @@ -37,13 +37,13 @@ public bool TryGetSize(string path, out ulong size) public void Dispose() { provider.Dispose(); - folderPreferences.PropertyChanged -= FolderPreferences_PropertyChangedAsync; + folderPreferences.PropertyChanged -= FolderPreferences_PropertyChanged; } private ISizeProvider GetProvider() => folderPreferences.CalculateFolderSizes ? new DrivesSizeProvider() : new NoSizeProvider(); - private async void FolderPreferences_PropertyChangedAsync(object sender, PropertyChangedEventArgs e) + private async void FolderPreferences_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName is nameof(IFoldersSettingsService.CalculateFolderSizes)) { diff --git a/src/Files.App/UserControls/FilePreviews/HtmlPreview.xaml b/src/Files.App/UserControls/FilePreviews/HtmlPreview.xaml index 0d976f1ea3de..1d8225f544e2 100644 --- a/src/Files.App/UserControls/FilePreviews/HtmlPreview.xaml +++ b/src/Files.App/UserControls/FilePreviews/HtmlPreview.xaml @@ -20,7 +20,7 @@ x:Name="WebViewControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - Loaded="WebViewControl_LoadedAsync" /> + Loaded="WebViewControl_Loaded" /> diff --git a/src/Files.App/UserControls/FilePreviews/HtmlPreview.xaml.cs b/src/Files.App/UserControls/FilePreviews/HtmlPreview.xaml.cs index c9c08ddfc791..097208fd9818 100644 --- a/src/Files.App/UserControls/FilePreviews/HtmlPreview.xaml.cs +++ b/src/Files.App/UserControls/FilePreviews/HtmlPreview.xaml.cs @@ -16,7 +16,7 @@ public HtmlPreview(HtmlPreviewViewModel model) public HtmlPreviewViewModel ViewModel { get; set; } - private async void WebViewControl_LoadedAsync(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) + private async void WebViewControl_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { await WebViewControl.EnsureCoreWebView2Async(); WebViewControl.CoreWebView2.SetVirtualHostNameToFolderMapping( diff --git a/src/Files.App/UserControls/PathBreadcrumb.xaml b/src/Files.App/UserControls/PathBreadcrumb.xaml index 396f904a717d..92a0d9dbbcac 100644 --- a/src/Files.App/UserControls/PathBreadcrumb.xaml +++ b/src/Files.App/UserControls/PathBreadcrumb.xaml @@ -28,8 +28,8 @@ AutomationProperties.Name="{x:Bind Title, Mode=OneWay}" Background="Transparent" DragLeave="PathBoxItem_DragLeave" - DragOver="PathBoxItem_DragOverAsync" - Drop="PathBoxItem_DropAsync" + DragOver="PathBoxItem_DragOver" + Drop="PathBoxItem_Drop" Orientation="Horizontal" Spacing="4" Tag="{x:Bind Path, Mode=OneWay}"> @@ -60,8 +60,8 @@ AutomationProperties.Name="{x:Bind Title, Mode=OneWay}" Background="Transparent" DragLeave="PathBoxItem_DragLeave" - DragOver="PathBoxItem_DragOverAsync" - Drop="PathBoxItem_DropAsync" + DragOver="PathBoxItem_DragOver" + Drop="PathBoxItem_Drop" Orientation="Horizontal" Spacing="4" Tag="{x:Bind Path, Mode=OneWay}"> @@ -71,7 +71,7 @@ Padding="0,4" FontSize="12" PointerPressed="PathBoxItem_PointerPressed" - Tapped="PathBoxItem_TappedAsync" + Tapped="PathBoxItem_Tapped" Text="{x:Bind Title, Mode=OneWay}"> diff --git a/src/Files.App/UserControls/PathBreadcrumb.xaml.cs b/src/Files.App/UserControls/PathBreadcrumb.xaml.cs index bd83f8816736..7ee8dd17d0be 100644 --- a/src/Files.App/UserControls/PathBreadcrumb.xaml.cs +++ b/src/Files.App/UserControls/PathBreadcrumb.xaml.cs @@ -30,19 +30,19 @@ private void PathBoxItem_DragLeave(object sender, DragEventArgs e) ViewModel.PathBoxItem_DragLeave(sender, e); } - private async void PathBoxItem_DragOverAsync(object sender, DragEventArgs e) + private async void PathBoxItem_DragOver(object sender, DragEventArgs e) { - await ViewModel.PathBoxItem_DragOverAsync(sender, e); + await ViewModel.PathBoxItem_DragOver(sender, e); } - private async void PathBoxItem_DropAsync(object sender, DragEventArgs e) + private async void PathBoxItem_Drop(object sender, DragEventArgs e) { - await ViewModel.PathBoxItem_DropAsync(sender, e); + await ViewModel.PathBoxItem_Drop(sender, e); } - private async void PathBoxItem_TappedAsync(object sender, TappedRoutedEventArgs e) + private async void PathBoxItem_Tapped(object sender, TappedRoutedEventArgs e) { - await ViewModel.PathBoxItem_TappedAsync(sender, e); + await ViewModel.PathBoxItem_Tapped(sender, e); } private void PathBoxItem_PointerPressed(object sender, PointerRoutedEventArgs e) diff --git a/src/Files.App/UserControls/TabBar/TabBar.xaml b/src/Files.App/UserControls/TabBar/TabBar.xaml index 1e10880bb312..efdd15677cf8 100644 --- a/src/Files.App/UserControls/TabBar/TabBar.xaml +++ b/src/Files.App/UserControls/TabBar/TabBar.xaml @@ -79,11 +79,11 @@ TabCloseRequested="TabView_TabCloseRequested" TabDragCompleted="TabView_TabDragCompleted" TabDragStarting="TabView_TabDragStarting" - TabDroppedOutside="TabView_TabDroppedOutsideAsync" + TabDroppedOutside="TabView_TabDroppedOutside" TabItemsChanged="TabView_TabItemsChanged" TabItemsSource="{x:Bind Items, Mode=OneWay}" TabStripDragOver="TabView_TabStripDragOver" - TabStripDrop="TabView_TabStripDropAsync" + TabStripDrop="TabView_TabStripDrop" Visibility="{x:Bind TabStripVisibility, Mode=OneWay}"> @@ -92,9 +92,9 @@ (); - ContentChanged -= mainPageViewModel.Control_ContentChangedAsync; + ContentChanged -= mainPageViewModel.Control_ContentChanged; Dispose(); } diff --git a/src/Files.App/UserControls/Widgets/DrivesWidget.xaml b/src/Files.App/UserControls/Widgets/DrivesWidget.xaml index 460e25c8520d..086bbf5a898d 100644 --- a/src/Files.App/UserControls/Widgets/DrivesWidget.xaml +++ b/src/Files.App/UserControls/Widgets/DrivesWidget.xaml @@ -35,10 +35,10 @@ HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutomationProperties.Name="{x:Bind Item.Text, Mode=OneWay}" - Click="Button_ClickAsync" + Click="Button_Click" CornerRadius="{StaticResource ControlCornerRadius}" DataContext="{x:Bind}" - PointerPressed="Button_PointerPressedAsync" + PointerPressed="Button_PointerPressed" RightTapped="Button_RightTapped" Tag="{x:Bind Item.Path}" ToolTipService.ToolTip="{x:Bind Item.Text, Mode=OneWay}"> diff --git a/src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs b/src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs index fd4b947c05b8..efe9201a5e15 100644 --- a/src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs +++ b/src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs @@ -122,9 +122,9 @@ public DrivesWidget() { InitializeComponent(); - Drives_CollectionChangedAsync(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + Drives_CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - drivesViewModel.Drives.CollectionChanged += Drives_CollectionChangedAsync; + drivesViewModel.Drives.CollectionChanged += Drives_CollectionChanged; FormatDriveCommand = new RelayCommand(FormatDrive); EjectDeviceCommand = new AsyncRelayCommand(EjectDeviceAsync); @@ -138,7 +138,7 @@ public DrivesWidget() DisconnectNetworkDriveCommand = new RelayCommand(DisconnectNetworkDrive); } - private async void Drives_CollectionChangedAsync(object? sender, NotifyCollectionChangedEventArgs e) + private async void Drives_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { await DispatcherQueue.EnqueueOrInvokeAsync(async () => { @@ -303,7 +303,7 @@ private void OpenProperties(DriveCardItem item) ItemContextMenuFlyout.Closed += flyoutClosed; } - private async void Button_ClickAsync(object sender, RoutedEventArgs e) + private async void Button_Click(object sender, RoutedEventArgs e) { string ClickedCard = (sender as Button).Tag.ToString(); string NavigationPath = ClickedCard; // path to navigate @@ -324,7 +324,7 @@ private async void Button_ClickAsync(object sender, RoutedEventArgs e) }); } - private async void Button_PointerPressedAsync(object sender, PointerRoutedEventArgs e) + private async void Button_PointerPressed(object sender, PointerRoutedEventArgs e) { if (!e.GetCurrentPoint(null).Properties.IsMiddleButtonPressed) // check middle click return; diff --git a/src/Files.App/UserControls/Widgets/FileTagsWidget.xaml b/src/Files.App/UserControls/Widgets/FileTagsWidget.xaml index e64c113fa2bc..e5e035a46b2f 100644 --- a/src/Files.App/UserControls/Widgets/FileTagsWidget.xaml +++ b/src/Files.App/UserControls/Widgets/FileTagsWidget.xaml @@ -119,7 +119,7 @@ HorizontalAlignment="Stretch" DesiredWidth="180" IsItemClickEnabled="True" - ItemClick="FileTagItem_ItemClickAsync" + ItemClick="FileTagItem_ItemClick" ItemsSource="{x:Bind Tags}" RightTapped="AdaptiveGridView_RightTapped" ScrollViewer.VerticalScrollBarVisibility="Hidden" diff --git a/src/Files.App/UserControls/Widgets/FileTagsWidget.xaml.cs b/src/Files.App/UserControls/Widgets/FileTagsWidget.xaml.cs index ea9c482dffd1..d51d6a8d9d32 100644 --- a/src/Files.App/UserControls/Widgets/FileTagsWidget.xaml.cs +++ b/src/Files.App/UserControls/Widgets/FileTagsWidget.xaml.cs @@ -93,7 +93,7 @@ private void OpenInNewPane(WidgetCardItem? item) }); } - private async void FileTagItem_ItemClickAsync(object sender, ItemClickEventArgs e) + private async void FileTagItem_ItemClick(object sender, ItemClickEventArgs e) { if (e.ClickedItem is FileTagsItemViewModel itemViewModel) await itemViewModel.ClickCommand.ExecuteAsync(null); @@ -134,16 +134,16 @@ private void LoadContextMenu( if (rightClickedItem is not null) { FlyouItemPath = rightClickedItem.Path; - ItemContextMenuFlyout.Opened += ItemContextMenuFlyout_OpenedAsync; + ItemContextMenuFlyout.Opened += ItemContextMenuFlyout_Opened; } itemContextMenuFlyout.ShowAt(element, new FlyoutShowOptions { Position = e.GetPosition(element) }); e.Handled = true; } - private async void ItemContextMenuFlyout_OpenedAsync(object? sender, object e) + private async void ItemContextMenuFlyout_Opened(object? sender, object e) { - ItemContextMenuFlyout.Opened -= ItemContextMenuFlyout_OpenedAsync; + ItemContextMenuFlyout.Opened -= ItemContextMenuFlyout_Opened; await ShellContextmenuHelper.LoadShellMenuItemsAsync(FlyouItemPath, ItemContextMenuFlyout, showOpenWithMenu: true, showSendToMenu: true); } diff --git a/src/Files.App/UserControls/Widgets/HomePageWidget.cs b/src/Files.App/UserControls/Widgets/HomePageWidget.cs index 5104495baa30..cee8a410444a 100644 --- a/src/Files.App/UserControls/Widgets/HomePageWidget.cs +++ b/src/Files.App/UserControls/Widgets/HomePageWidget.cs @@ -47,15 +47,15 @@ public void Button_RightTapped(object sender, RightTappedRoutedEventArgs e) secondaryElements.ForEach(i => itemContextMenuFlyout.SecondaryCommands.Add(i)); ItemContextMenuFlyout = itemContextMenuFlyout; FlyouItemPath = item.Path; - ItemContextMenuFlyout.Opened += ItemContextMenuFlyout_OpenedAsync; + ItemContextMenuFlyout.Opened += ItemContextMenuFlyout_Opened; itemContextMenuFlyout.ShowAt(widgetCardItem, new FlyoutShowOptions { Position = e.GetPosition(widgetCardItem) }); e.Handled = true; } - private async void ItemContextMenuFlyout_OpenedAsync(object? sender, object e) + private async void ItemContextMenuFlyout_Opened(object? sender, object e) { - ItemContextMenuFlyout.Opened -= ItemContextMenuFlyout_OpenedAsync; + ItemContextMenuFlyout.Opened -= ItemContextMenuFlyout_Opened; await ShellContextmenuHelper.LoadShellMenuItemsAsync(FlyouItemPath, ItemContextMenuFlyout); } diff --git a/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml b/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml index 0f65dd904787..363994e5fc2c 100644 --- a/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml +++ b/src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml @@ -34,10 +34,10 @@ HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutomationProperties.Name="{x:Bind AutomationProperties}" - Click="Button_ClickAsync" + Click="Button_Click" CornerRadius="{StaticResource ControlCornerRadius}" DataContext="{x:Bind}" - PointerPressed="Button_PointerPressedAsync" + PointerPressed="Button_PointerPressed" RightTapped="Button_RightTapped" Tag="{x:Bind Path}"> (OpenInNewTabAsync); @@ -281,9 +281,9 @@ await DispatcherQueue.EnqueueOrInvokeAsync(async () => }); } - private async void QuickAccessWidget_LoadedAsync(object sender, RoutedEventArgs e) + private async void QuickAccessWidget_Loaded(object sender, RoutedEventArgs e) { - Loaded -= QuickAccessWidget_LoadedAsync; + Loaded -= QuickAccessWidget_Loaded; var itemsToAdd = await QuickAccessService.GetPinnedFoldersAsync(); ModifyItemAsync(this, new ModifyQuickAccessEventArgs(itemsToAdd.ToArray(), false) @@ -300,7 +300,7 @@ private void QuickAccessWidget_Unloaded(object sender, RoutedEventArgs e) App.QuickAccessManager.UpdateQuickAccessWidget -= ModifyItemAsync; } - private static async void ItemsAdded_CollectionChangedAsync(object? sender, NotifyCollectionChangedEventArgs e) + private static async void ItemsAdded_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { if (e.Action is NotifyCollectionChangedAction.Add) { @@ -330,7 +330,7 @@ private void OpenInNewPane(FolderCardItem item) CardNewPaneInvoked?.Invoke(this, new QuickAccessCardInvokedEventArgs { Path = item.Path }); } - private async void Button_PointerPressedAsync(object sender, PointerRoutedEventArgs e) + private async void Button_PointerPressed(object sender, PointerRoutedEventArgs e) { if (e.GetCurrentPoint(null).Properties.IsMiddleButtonPressed) // check middle click { @@ -376,7 +376,7 @@ public override async Task UnpinFromFavoritesAsync(WidgetCardItem item) ModifyItemAsync(this, new ModifyQuickAccessEventArgs(new[] { item.Path }, false)); } - private async void Button_ClickAsync(object sender, RoutedEventArgs e) + private async void Button_Click(object sender, RoutedEventArgs e) { string ClickedCard = (sender as Button).Tag.ToString(); string NavigationPath = ClickedCard; // path to navigate diff --git a/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs b/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs index 4fb65f1134e7..65034b122693 100644 --- a/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs +++ b/src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs @@ -99,7 +99,7 @@ public RecentFilesWidget() // recent files could have changed while widget wasn't loaded _ = RefreshWidgetAsync(); - App.RecentItemsManager.RecentFilesChanged += Manager_RecentFilesChangedAsync; + App.RecentItemsManager.RecentFilesChanged += Manager_RecentFilesChanged; RemoveRecentItemCommand = new AsyncRelayCommand(RemoveRecentItemAsync); ClearAllItemsCommand = new AsyncRelayCommand(ClearRecentItemsAsync); @@ -122,13 +122,13 @@ private void ListView_RightTapped(object sender, RightTappedRoutedEventArgs e) secondaryElements.ForEach(i => ItemContextMenuFlyout.SecondaryCommands.Add(i)); FlyouItemPath = item.Path; - ItemContextMenuFlyout.Opened += ItemContextMenuFlyout_OpenedAsync; + ItemContextMenuFlyout.Opened += ItemContextMenuFlyout_Opened; ItemContextMenuFlyout.ShowAt(element, new FlyoutShowOptions { Position = e.GetPosition(element) }); } - private async void ItemContextMenuFlyout_OpenedAsync(object? sender, object e) + private async void ItemContextMenuFlyout_Opened(object? sender, object e) { - ItemContextMenuFlyout.Opened -= ItemContextMenuFlyout_OpenedAsync; + ItemContextMenuFlyout.Opened -= ItemContextMenuFlyout_Opened; await ShellContextmenuHelper.LoadShellMenuItemsAsync(FlyouItemPath, ItemContextMenuFlyout, showOpenWithMenu: true, showSendToMenu: true); } @@ -204,7 +204,7 @@ public async Task RefreshWidgetAsync() await App.RecentItemsManager.UpdateRecentFilesAsync(); } - private async void Manager_RecentFilesChangedAsync(object sender, NotifyCollectionChangedEventArgs e) + private async void Manager_RecentFilesChanged(object sender, NotifyCollectionChangedEventArgs e) { await DispatcherQueue.EnqueueOrInvokeAsync(async () => { @@ -376,7 +376,7 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "") public void Dispose() { - App.RecentItemsManager.RecentFilesChanged -= Manager_RecentFilesChangedAsync; + App.RecentItemsManager.RecentFilesChanged -= Manager_RecentFilesChanged; } } } \ No newline at end of file diff --git a/src/Files.App/Utils/Global/WindowsStorageDeviceWatcher.cs b/src/Files.App/Utils/Global/WindowsStorageDeviceWatcher.cs index 52269d94bb22..f07a8be28003 100644 --- a/src/Files.App/Utils/Global/WindowsStorageDeviceWatcher.cs +++ b/src/Files.App/Utils/Global/WindowsStorageDeviceWatcher.cs @@ -27,7 +27,7 @@ public class WindowsStorageDeviceWatcher : IStorageDeviceWatcher public WindowsStorageDeviceWatcher() { watcher = DeviceInformation.CreateWatcher(StorageDevice.GetDeviceSelector()); - watcher.Added += Watcher_AddedAsync; + watcher.Added += Watcher_Added; watcher.Removed += Watcher_Removed; watcher.EnumerationCompleted += Watcher_EnumerationCompleted; @@ -36,7 +36,7 @@ public WindowsStorageDeviceWatcher() private void SetupWin32Watcher() { - DeviceManager.Default.DeviceAdded += Win32_OnDeviceAddedAsync; + DeviceManager.Default.DeviceAdded += Win32_OnDeviceAdded; DeviceManager.Default.DeviceRemoved += Win32_OnDeviceRemoved; DeviceManager.Default.DeviceInserted += Win32_OnDeviceEjectedOrInserted; DeviceManager.Default.DeviceEjected += Win32_OnDeviceEjectedOrInserted; @@ -52,7 +52,7 @@ private void Win32_OnDeviceRemoved(object? sender, DeviceEventArgs e) DeviceRemoved?.Invoke(this, e.DeviceId); } - private async void Win32_OnDeviceAddedAsync(object? sender, DeviceEventArgs e) + private async void Win32_OnDeviceAdded(object? sender, DeviceEventArgs e) { var driveAdded = new DriveInfo(e.DeviceId); var rootAdded = await FilesystemTasks.Wrap(() => StorageFolder.GetFolderFromPathAsync(e.DeviceId).AsTask()); @@ -80,7 +80,7 @@ private void Watcher_Removed(DeviceWatcher sender, DeviceInformationUpdate args) DeviceRemoved?.Invoke(this, args.Id); } - private async void Watcher_AddedAsync(DeviceWatcher sender, DeviceInformation args) + private async void Watcher_Added(DeviceWatcher sender, DeviceInformation args) { string deviceId = args.Id; StorageFolder root; @@ -127,11 +127,11 @@ public void Stop() watcher.Stop(); } - watcher.Added -= Watcher_AddedAsync; + watcher.Added -= Watcher_Added; watcher.Removed -= Watcher_Removed; watcher.EnumerationCompleted -= Watcher_EnumerationCompleted; - DeviceManager.Default.DeviceAdded -= Win32_OnDeviceAddedAsync; + DeviceManager.Default.DeviceAdded -= Win32_OnDeviceAdded; DeviceManager.Default.DeviceRemoved -= Win32_OnDeviceRemoved; DeviceManager.Default.DeviceInserted -= Win32_OnDeviceEjectedOrInserted; DeviceManager.Default.DeviceEjected -= Win32_OnDeviceEjectedOrInserted; diff --git a/src/Files.App/ViewModels/MainPageViewModel.cs b/src/Files.App/ViewModels/MainPageViewModel.cs index 59ae6d10f4fc..2e862bc0c162 100644 --- a/src/Files.App/ViewModels/MainPageViewModel.cs +++ b/src/Files.App/ViewModels/MainPageViewModel.cs @@ -126,7 +126,7 @@ public async Task AddNewTabByPathAsync(Type type, string? path, int atIndex = -1 InitialPageType = type, NavigationParameter = path }; - tabItem.ContentChanged += Control_ContentChangedAsync; + tabItem.ContentChanged += Control_ContentChanged; await UpdateTabInfoAsync(tabItem, path); var index = atIndex == -1 ? AppInstances.Count : atIndex; AppInstances.Insert(index, tabItem); @@ -421,7 +421,7 @@ public async Task AddNewTabByParamAsync(Type type, object tabViewItemArgs, int a NavigationParameter = tabViewItemArgs }; - tabItem.ContentChanged += Control_ContentChangedAsync; + tabItem.ContentChanged += Control_ContentChanged; await UpdateTabInfoAsync(tabItem, tabViewItemArgs); @@ -430,7 +430,7 @@ public async Task AddNewTabByParamAsync(Type type, object tabViewItemArgs, int a App.AppModel.TabStripSelectedIndex = index; } - public async void Control_ContentChangedAsync(object? sender, CustomTabViewItemParameter e) + public async void Control_ContentChanged(object? sender, CustomTabViewItemParameter e) { if (sender is null) return; diff --git a/src/Files.App/ViewModels/Properties/BasePropertiesPage.cs b/src/Files.App/ViewModels/Properties/BasePropertiesPage.cs index fb3726978511..fb71e25e2c9f 100644 --- a/src/Files.App/ViewModels/Properties/BasePropertiesPage.cs +++ b/src/Files.App/ViewModels/Properties/BasePropertiesPage.cs @@ -16,7 +16,7 @@ public abstract class BasePropertiesPage : Page, IDisposable public SelectedItemsPropertiesViewModel ViewModel { get; set; } = new(); - protected virtual void Properties_LoadedAsync(object sender, RoutedEventArgs e) + protected virtual void Properties_Loaded(object sender, RoutedEventArgs e) { BaseProperties?.GetSpecialPropertiesAsync(); } diff --git a/src/Files.App/ViewModels/Properties/Items/FileProperties.cs b/src/Files.App/ViewModels/Properties/Items/FileProperties.cs index 1bc9e1e53981..f06d0666d896 100644 --- a/src/Files.App/ViewModels/Properties/Items/FileProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/FileProperties.cs @@ -26,7 +26,7 @@ public FileProperties( GetBaseProperties(); - ViewModel.PropertyChanged += ViewModel_PropertyChangedAsync; + ViewModel.PropertyChanged += ViewModel_PropertyChanged; } public override void GetBaseProperties() @@ -257,7 +257,7 @@ public async Task ClearPropertiesAsync() _ = GetSystemFilePropertiesAsync(); } - private async void ViewModel_PropertyChangedAsync(object sender, System.ComponentModel.PropertyChangedEventArgs e) + private async void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { switch (e.PropertyName) { diff --git a/src/Files.App/ViewModels/Properties/Items/FolderProperties.cs b/src/Files.App/ViewModels/Properties/Items/FolderProperties.cs index 24e9d197036b..117dbc0e519f 100644 --- a/src/Files.App/ViewModels/Properties/Items/FolderProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/FolderProperties.cs @@ -27,7 +27,7 @@ public FolderProperties( GetBaseProperties(); - ViewModel.PropertyChanged += ViewModel_PropertyChangedAsync; + ViewModel.PropertyChanged += ViewModel_PropertyChanged; } public override void GetBaseProperties() @@ -186,7 +186,7 @@ private async Task GetFolderSizeAsync(string folderPath, CancellationToken token SetItemsCountString(); } - private async void ViewModel_PropertyChangedAsync(object sender, System.ComponentModel.PropertyChangedEventArgs e) + private async void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { switch (e.PropertyName) { diff --git a/src/Files.App/ViewModels/UserControls/PreviewPaneViewModel.cs b/src/Files.App/ViewModels/UserControls/PreviewPaneViewModel.cs index 7b876b52a7f1..0cc32265f272 100644 --- a/src/Files.App/ViewModels/UserControls/PreviewPaneViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/PreviewPaneViewModel.cs @@ -98,7 +98,7 @@ public PreviewPaneViewModel(IPreviewPaneSettingsService previewSettings, IConten IsEnabled = previewSettingsService.IsEnabled; - previewSettingsService.PropertyChanged += PreviewSettingsService_OnPropertyChangedEventAsync; + previewSettingsService.PropertyChanged += PreviewSettingsService_OnPropertyChangedEvent; this.contentPageContextService = contentPageContextService ?? Ioc.Default.GetRequiredService(); } @@ -355,7 +355,7 @@ public void UpdateDateDisplay() public ICommand ShowPreviewOnlyInvoked { get; } - private async void PreviewSettingsService_OnPropertyChangedEventAsync(object sender, PropertyChangedEventArgs e) + private async void PreviewSettingsService_OnPropertyChangedEvent(object sender, PropertyChangedEventArgs e) { if (e.PropertyName is nameof(IPreviewPaneSettingsService.ShowPreviewOnly)) { @@ -408,7 +408,7 @@ private void UpdateTagsItems() public void Dispose() { - previewSettingsService.PropertyChanged -= PreviewSettingsService_OnPropertyChangedEventAsync; + previewSettingsService.PropertyChanged -= PreviewSettingsService_OnPropertyChangedEvent; } } } diff --git a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs index 6aee1824e4a8..77fc35799aba 100644 --- a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs @@ -239,21 +239,21 @@ public SidebarViewModel() UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEvent; CreateItemHomeAsync(); - Manager_DataChangedAsync(SectionType.Favorites, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - Manager_DataChangedAsync(SectionType.Library, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - Manager_DataChangedAsync(SectionType.Drives, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - Manager_DataChangedAsync(SectionType.CloudDrives, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - Manager_DataChangedAsync(SectionType.Network, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - Manager_DataChangedAsync(SectionType.WSL, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - Manager_DataChangedAsync(SectionType.FileTag, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - - App.QuickAccessManager.Model.DataChanged += Manager_DataChangedAsync; - App.LibraryManager.DataChanged += Manager_DataChangedAsync; - drivesViewModel.Drives.CollectionChanged += (x, args) => Manager_DataChangedAsync(SectionType.Drives, args); - App.CloudDrivesManager.DataChanged += Manager_DataChangedAsync; - networkDrivesViewModel.Drives.CollectionChanged += (x, args) => Manager_DataChangedAsync(SectionType.Network, args); - App.WSLDistroManager.DataChanged += Manager_DataChangedAsync; - App.FileTagsManager.DataChanged += Manager_DataChangedAsync; + Manager_DataChanged(SectionType.Favorites, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + Manager_DataChanged(SectionType.Library, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + Manager_DataChanged(SectionType.Drives, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + Manager_DataChanged(SectionType.CloudDrives, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + Manager_DataChanged(SectionType.Network, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + Manager_DataChanged(SectionType.WSL, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + Manager_DataChanged(SectionType.FileTag, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + + App.QuickAccessManager.Model.DataChanged += Manager_DataChanged; + App.LibraryManager.DataChanged += Manager_DataChanged; + drivesViewModel.Drives.CollectionChanged += (x, args) => Manager_DataChanged(SectionType.Drives, args); + App.CloudDrivesManager.DataChanged += Manager_DataChanged; + networkDrivesViewModel.Drives.CollectionChanged += (x, args) => Manager_DataChanged(SectionType.Network, args); + App.WSLDistroManager.DataChanged += Manager_DataChanged; + App.FileTagsManager.DataChanged += Manager_DataChanged; SidebarDisplayMode = UserSettingsService.AppearanceSettingsService.IsSidebarOpen ? SidebarDisplayMode.Expanded : SidebarDisplayMode.Compact; HideSectionCommand = new RelayCommand(HideSection); @@ -273,7 +273,7 @@ private Task CreateItemHomeAsync() return CreateSectionAsync(SectionType.Home); } - private async void Manager_DataChangedAsync(object sender, NotifyCollectionChangedEventArgs e) + private async void Manager_DataChanged(object sender, NotifyCollectionChangedEventArgs e) { await dispatcherQueue.EnqueueOrInvokeAsync(async () => { @@ -587,7 +587,7 @@ public async Task UpdateSectionVisibilityAsync(SectionType sectionType, bool sho _ => () => Task.CompletedTask }; - Manager_DataChangedAsync(sectionType, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); + Manager_DataChanged(sectionType, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); await action(); } @@ -642,13 +642,13 @@ public void Dispose() { UserSettingsService.OnSettingChangedEvent -= UserSettingsService_OnSettingChangedEvent; - App.QuickAccessManager.Model.DataChanged -= Manager_DataChangedAsync; - App.LibraryManager.DataChanged -= Manager_DataChangedAsync; - drivesViewModel.Drives.CollectionChanged -= (x, args) => Manager_DataChangedAsync(SectionType.Drives, args); - App.CloudDrivesManager.DataChanged -= Manager_DataChangedAsync; - networkDrivesViewModel.Drives.CollectionChanged -= (x, args) => Manager_DataChangedAsync(SectionType.Network, args); - App.WSLDistroManager.DataChanged -= Manager_DataChangedAsync; - App.FileTagsManager.DataChanged -= Manager_DataChangedAsync; + App.QuickAccessManager.Model.DataChanged -= Manager_DataChanged; + App.LibraryManager.DataChanged -= Manager_DataChanged; + drivesViewModel.Drives.CollectionChanged -= (x, args) => Manager_DataChanged(SectionType.Drives, args); + App.CloudDrivesManager.DataChanged -= Manager_DataChanged; + networkDrivesViewModel.Drives.CollectionChanged -= (x, args) => Manager_DataChanged(SectionType.Network, args); + App.WSLDistroManager.DataChanged -= Manager_DataChanged; + App.FileTagsManager.DataChanged -= Manager_DataChanged; } public void UpdateTabControlMargin() @@ -699,17 +699,17 @@ public async void HandleItemContextInvokedAsync(object sender, ItemContextInvoke secondaryElements.ForEach(i => itemContextMenuFlyout.SecondaryCommands.Add(i)); if (item.MenuOptions.ShowShellItems) - itemContextMenuFlyout.Opened += ItemContextMenuFlyout_OpenedAsync; + itemContextMenuFlyout.Opened += ItemContextMenuFlyout_Opened; itemContextMenuFlyout.ShowAt(sidebarItem, new FlyoutShowOptions { Position = args.Position }); } - private async void ItemContextMenuFlyout_OpenedAsync(object? sender, object e) + private async void ItemContextMenuFlyout_Opened(object? sender, object e) { if (sender is not CommandBarFlyout itemContextMenuFlyout) return; - itemContextMenuFlyout.Opened -= ItemContextMenuFlyout_OpenedAsync; + itemContextMenuFlyout.Opened -= ItemContextMenuFlyout_Opened; await ShellContextmenuHelper.LoadShellMenuItemsAsync(rightClickedItem.Path, itemContextMenuFlyout, rightClickedItem.MenuOptions); } diff --git a/src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs index 53abf125280d..e8bb78024997 100644 --- a/src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs @@ -211,10 +211,10 @@ public ToolbarViewModel() SearchBox.Escaped += SearchRegion_Escaped; UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEvent; - UpdateService.PropertyChanged += UpdateService_OnPropertyChangedAsync; + UpdateService.PropertyChanged += UpdateService_OnPropertyChanged; } - private async void UpdateService_OnPropertyChangedAsync(object? sender, PropertyChangedEventArgs e) + private async void UpdateService_OnPropertyChanged(object? sender, PropertyChangedEventArgs e) { IsUpdateAvailable = UpdateService.IsUpdateAvailable; IsUpdating = UpdateService.IsUpdating; @@ -297,7 +297,7 @@ public void PathBoxItem_DragLeave(object sender, DragEventArgs e) private bool lockFlag = false; - public async Task PathBoxItem_DropAsync(object sender, DragEventArgs e) + public async Task PathBoxItem_Drop(object sender, DragEventArgs e) { if (lockFlag) return; @@ -333,7 +333,7 @@ public async Task PathBoxItem_DropAsync(object sender, DragEventArgs e) lockFlag = false; } - public async Task PathBoxItem_DragOverAsync(object sender, DragEventArgs e) + public async Task PathBoxItem_DragOver(object sender, DragEventArgs e) { if (IsSingleItemOverride || ((StackPanel)sender).DataContext is not PathBoxItem pathBoxItem || @@ -494,7 +494,7 @@ public void PathBoxItem_PointerPressed(object sender, PointerRoutedEventArgs e) pointerRoutedEventArgs = ptrPt.Properties.IsMiddleButtonPressed ? e : null; } - public async Task PathBoxItem_TappedAsync(object sender, TappedRoutedEventArgs e) + public async Task PathBoxItem_Tapped(object sender, TappedRoutedEventArgs e) { var itemTappedPath = ((sender as TextBlock)?.DataContext as PathBoxItem)?.Path; if (itemTappedPath is null) diff --git a/src/Files.App/Views/HomePage.xaml.cs b/src/Files.App/Views/HomePage.xaml.cs index c5ca7f99baf9..5cdfd8aa8b48 100644 --- a/src/Files.App/Views/HomePage.xaml.cs +++ b/src/Files.App/Views/HomePage.xaml.cs @@ -69,10 +69,10 @@ public void ReloadWidgets() quickAccessWidget.CardInvoked -= QuickAccessWidget_CardInvoked; quickAccessWidget.CardNewPaneInvoked -= WidgetCardNewPaneInvoked; - quickAccessWidget.CardPropertiesInvoked -= QuickAccessWidget_CardPropertiesInvokedAsync; + quickAccessWidget.CardPropertiesInvoked -= QuickAccessWidget_CardPropertiesInvoked; quickAccessWidget.CardInvoked += QuickAccessWidget_CardInvoked; quickAccessWidget.CardNewPaneInvoked += WidgetCardNewPaneInvoked; - quickAccessWidget.CardPropertiesInvoked += QuickAccessWidget_CardPropertiesInvokedAsync; + quickAccessWidget.CardPropertiesInvoked += QuickAccessWidget_CardPropertiesInvoked; } // Reload DrivesWidget @@ -108,9 +108,9 @@ public void ReloadWidgets() recentFilesWidget.AppInstance = AppInstance; recentFilesWidget.RecentFilesOpenLocationInvoked -= WidgetOpenLocationInvoked; - recentFilesWidget.RecentFileInvoked -= RecentFilesWidget_RecentFileInvokedAsync; + recentFilesWidget.RecentFileInvoked -= RecentFilesWidget_RecentFileInvoked; recentFilesWidget.RecentFilesOpenLocationInvoked += WidgetOpenLocationInvoked; - recentFilesWidget.RecentFileInvoked += RecentFilesWidget_RecentFileInvokedAsync; + recentFilesWidget.RecentFileInvoked += RecentFilesWidget_RecentFileInvoked; } } @@ -122,7 +122,7 @@ private void ViewModel_YourHomeLoadedInvoked(object? sender, Microsoft.UI.Xaml.R ReloadWidgets(); } - private async void RecentFilesWidget_RecentFileInvokedAsync(object sender, PathNavigationEventArgs e) + private async void RecentFilesWidget_RecentFileInvoked(object sender, PathNavigationEventArgs e) { try { @@ -173,7 +173,7 @@ private void WidgetCardNewPaneInvoked(object sender, QuickAccessCardInvokedEvent AppInstance.PaneHolder?.OpenPathInNewPane(e.Path); } - private async void QuickAccessWidget_CardPropertiesInvokedAsync(object sender, QuickAccessCardEventArgs e) + private async void QuickAccessWidget_CardPropertiesInvoked(object sender, QuickAccessCardEventArgs e) { ListedItem listedItem = new(null!) { @@ -220,8 +220,8 @@ private async Task OnNavigatedToAsync(NavigationEventArgs eventArgs) AppInstance.ToolbarViewModel.CanGoForward = AppInstance.CanNavigateForward; AppInstance.ToolbarViewModel.CanNavigateToParent = false; - AppInstance.ToolbarViewModel.RefreshRequested -= ToolbarViewModel_RefreshRequestedAsync; - AppInstance.ToolbarViewModel.RefreshRequested += ToolbarViewModel_RefreshRequestedAsync; + AppInstance.ToolbarViewModel.RefreshRequested -= ToolbarViewModel_RefreshRequested; + AppInstance.ToolbarViewModel.RefreshRequested += ToolbarViewModel_RefreshRequested; // Set path of working directory empty await AppInstance.FilesystemViewModel.SetWorkingDirectoryAsync("Home"); @@ -246,10 +246,10 @@ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); - AppInstance.ToolbarViewModel.RefreshRequested -= ToolbarViewModel_RefreshRequestedAsync; + AppInstance.ToolbarViewModel.RefreshRequested -= ToolbarViewModel_RefreshRequested; } - private async void ToolbarViewModel_RefreshRequestedAsync(object? sender, EventArgs e) + private async void ToolbarViewModel_RefreshRequested(object? sender, EventArgs e) { AppInstance.ToolbarViewModel.CanRefresh = false; await Task.WhenAll(Widgets.ViewModel.Widgets.Select(w => w.WidgetItemModel.RefreshWidgetAsync())); @@ -260,7 +260,7 @@ public void Dispose() { ViewModel.YourHomeLoadedInvoked -= ViewModel_YourHomeLoadedInvoked; Widgets.ViewModel.WidgetListRefreshRequestedInvoked -= ViewModel_WidgetListRefreshRequestedInvoked; - AppInstance.ToolbarViewModel.RefreshRequested -= ToolbarViewModel_RefreshRequestedAsync; + AppInstance.ToolbarViewModel.RefreshRequested -= ToolbarViewModel_RefreshRequested; ViewModel?.Dispose(); } } diff --git a/src/Files.App/Views/LayoutModes/BaseLayout.cs b/src/Files.App/Views/LayoutModes/BaseLayout.cs index 70ca3051c44f..ea3dd8e88b95 100644 --- a/src/Files.App/Views/LayoutModes/BaseLayout.cs +++ b/src/Files.App/Views/LayoutModes/BaseLayout.cs @@ -269,7 +269,7 @@ public BaseLayout() jumpTimer.Interval = TimeSpan.FromSeconds(0.8); jumpTimer.Tick += JumpTimer_Tick; - Item_DragOverEventHandler = new DragEventHandler(Item_DragOverAsync); + Item_DragOverEventHandler = new DragEventHandler(Item_DragOver); SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel(); DirectoryPropertiesViewModel = new DirectoryPropertiesViewModel(); @@ -387,9 +387,9 @@ private async Task OnNavigatedToAsync(NavigationEventArgs eventArgs) IsItemSelected = false; FolderSettings!.LayoutModeChangeRequested += BaseFolderSettings_LayoutModeChangeRequested; - FolderSettings.GroupOptionPreferenceUpdated += FolderSettings_GroupOptionPreferenceUpdatedAsync; - FolderSettings.GroupDirectionPreferenceUpdated += FolderSettings_GroupDirectionPreferenceUpdatedAsync; - FolderSettings.GroupByDateUnitPreferenceUpdated += FolderSettings_GroupByDateUnitPreferenceUpdatedAsync; + FolderSettings.GroupOptionPreferenceUpdated += FolderSettings_GroupOptionPreferenceUpdated; + FolderSettings.GroupDirectionPreferenceUpdated += FolderSettings_GroupDirectionPreferenceUpdated; + FolderSettings.GroupByDateUnitPreferenceUpdated += FolderSettings_GroupByDateUnitPreferenceUpdated; ParentShellPageInstance.FilesystemViewModel.EmptyTextType = EmptyTextType.None; ParentShellPageInstance.ToolbarViewModel.CanRefresh = true; @@ -473,8 +473,8 @@ private async Task OnNavigatedToAsync(NavigationEventArgs eventArgs) SetSelectedItemsOnNavigation(); - ItemContextMenuFlyout.Opening += ItemContextFlyout_OpeningAsync; - BaseContextMenuFlyout.Opening += BaseContextFlyout_OpeningAsync; + ItemContextMenuFlyout.Opening += ItemContextFlyout_Opening; + BaseContextMenuFlyout.Opening += BaseContextFlyout_Opening; // Git properties are not loaded by default ParentShellPageInstance.FilesystemViewModel.EnabledGitProperties = GitProperties.None; @@ -508,17 +508,17 @@ navigationArguments.SelectItems is not null && private CancellationTokenSource? groupingCancellationToken; - private async void FolderSettings_GroupOptionPreferenceUpdatedAsync(object? sender, GroupOption e) + private async void FolderSettings_GroupOptionPreferenceUpdated(object? sender, GroupOption e) { await GroupPreferenceUpdatedAsync(); } - private async void FolderSettings_GroupDirectionPreferenceUpdatedAsync(object? sender, SortDirection e) + private async void FolderSettings_GroupDirectionPreferenceUpdated(object? sender, SortDirection e) { await GroupPreferenceUpdatedAsync(); } - private async void FolderSettings_GroupByDateUnitPreferenceUpdatedAsync(object? sender, GroupByDateUnit e) + private async void FolderSettings_GroupByDateUnitPreferenceUpdated(object? sender, GroupByDateUnit e) { await GroupPreferenceUpdatedAsync(); } @@ -544,11 +544,11 @@ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) // Remove item jumping handler CharacterReceived -= Page_CharacterReceived; FolderSettings!.LayoutModeChangeRequested -= BaseFolderSettings_LayoutModeChangeRequested; - FolderSettings.GroupOptionPreferenceUpdated -= FolderSettings_GroupOptionPreferenceUpdatedAsync; - FolderSettings.GroupDirectionPreferenceUpdated -= FolderSettings_GroupDirectionPreferenceUpdatedAsync; - FolderSettings.GroupByDateUnitPreferenceUpdated -= FolderSettings_GroupByDateUnitPreferenceUpdatedAsync; - ItemContextMenuFlyout.Opening -= ItemContextFlyout_OpeningAsync; - BaseContextMenuFlyout.Opening -= BaseContextFlyout_OpeningAsync; + FolderSettings.GroupOptionPreferenceUpdated -= FolderSettings_GroupOptionPreferenceUpdated; + FolderSettings.GroupDirectionPreferenceUpdated -= FolderSettings_GroupDirectionPreferenceUpdated; + FolderSettings.GroupByDateUnitPreferenceUpdated -= FolderSettings_GroupByDateUnitPreferenceUpdated; + ItemContextMenuFlyout.Opening -= ItemContextFlyout_Opening; + BaseContextMenuFlyout.Opening -= BaseContextFlyout_Opening; var parameter = e.Parameter as NavigationArguments; if (parameter is not null && !parameter.IsLayoutSwitch) @@ -558,7 +558,7 @@ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) private CancellationTokenSource? shellContextMenuItemCancellationToken; private bool shiftPressed; - private async void ItemContextFlyout_OpeningAsync(object? sender, object e) + private async void ItemContextFlyout_Opening(object? sender, object e) { App.LastOpenedFlyout = sender as CommandBarFlyout; @@ -621,7 +621,7 @@ private async void ItemContextFlyout_OpeningAsync(object? sender, object e) } } - private async void BaseContextFlyout_OpeningAsync(object? sender, object e) + private async void BaseContextFlyout_Opening(object? sender, object e) { App.LastOpenedFlyout = sender as CommandBarFlyout; @@ -1000,7 +1000,7 @@ private void Item_DragLeave(object sender, DragEventArgs e) dragOverItem = null; } - private async void Item_DragOverAsync(object sender, DragEventArgs e) + private async void Item_DragOver(object sender, DragEventArgs e) { var item = GetItemFromElement(sender); if (item is null) @@ -1097,7 +1097,7 @@ private async void Item_DragOverAsync(object sender, DragEventArgs e) } } - private async void Item_DropAsync(object sender, DragEventArgs e) + private async void Item_Drop(object sender, DragEventArgs e) { var deferral = e.GetDeferral(); @@ -1259,7 +1259,7 @@ protected void InitializeDrag(UIElement container, ListedItem item) container.AllowDrop = true; container.AddHandler(UIElement.DragOverEvent, Item_DragOverEventHandler, true); container.DragLeave += Item_DragLeave; - container.Drop += Item_DropAsync; + container.Drop += Item_Drop; } } @@ -1268,7 +1268,7 @@ protected void UninitializeDrag(UIElement element) element.AllowDrop = false; element.RemoveHandler(UIElement.DragOverEvent, Item_DragOverEventHandler); element.DragLeave -= Item_DragLeave; - element.Drop -= Item_DropAsync; + element.Drop -= Item_Drop; } // VirtualKey doesn't support or accept plus and minus by default. diff --git a/src/Files.App/Views/LayoutModes/ColumnViewBase.xaml b/src/Files.App/Views/LayoutModes/ColumnViewBase.xaml index 4848d6b4ee1c..d53c8f3b7de9 100644 --- a/src/Files.App/Views/LayoutModes/ColumnViewBase.xaml +++ b/src/Files.App/Views/LayoutModes/ColumnViewBase.xaml @@ -170,12 +170,12 @@ IsRightTapEnabled="True" IsTabStop="True" ItemsSource="{x:Bind CollectionViewSource.View, Mode=OneWay}" - PreviewKeyDown="FileList_PreviewKeyDownAsync" + PreviewKeyDown="FileList_PreviewKeyDown" RightTapped="FileList_RightTapped" ScrollViewer.IsScrollInertiaEnabled="True" SelectionChanged="FileList_SelectionChanged" SelectionMode="Extended" - Tapped="FileList_ItemTappedAsync"> + Tapped="FileList_ItemTapped"> @@ -288,7 +288,7 @@ Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - BeforeTextChanging="ItemNameTextBox_BeforeTextChangingAsync" + BeforeTextChanging="ItemNameTextBox_BeforeTextChanging" TextAlignment="Left" TextWrapping="Wrap" Visibility="Collapsed" /> diff --git a/src/Files.App/Views/LayoutModes/ColumnViewBase.xaml.cs b/src/Files.App/Views/LayoutModes/ColumnViewBase.xaml.cs index e427b1f362b1..277c7bdac103 100644 --- a/src/Files.App/Views/LayoutModes/ColumnViewBase.xaml.cs +++ b/src/Files.App/Views/LayoutModes/ColumnViewBase.xaml.cs @@ -151,7 +151,7 @@ override public void StartRenameItem() StartRenameItem("ListViewTextBoxItemName"); } - private async void ItemNameTextBox_BeforeTextChangingAsync(TextBox textBox, TextBoxBeforeTextChangingEventArgs args) + private async void ItemNameTextBox_BeforeTextChanging(TextBox textBox, TextBoxBeforeTextChangingEventArgs args) { if (IsRenamingItem) { @@ -176,8 +176,8 @@ protected override void EndRename(TextBox textBox) textBlock!.Visibility = Visibility.Visible; } - textBox!.LostFocus -= RenameTextBox_LostFocusAsync; - textBox.KeyDown -= RenameTextBox_KeyDownAsync; + textBox!.LostFocus -= RenameTextBox_LostFocus; + textBox.KeyDown -= RenameTextBox_KeyDown; FileNameTeachingTip.IsOpen = false; IsRenamingItem = false; } @@ -240,7 +240,7 @@ private void FileList_RightTapped(object sender, RightTappedRoutedEventArgs e) HandleRightClick(); } - protected override async void FileList_PreviewKeyDownAsync(object sender, KeyRoutedEventArgs e) + protected override async void FileList_PreviewKeyDown(object sender, KeyRoutedEventArgs e) { if ( @@ -367,7 +367,7 @@ private void HandleRightClick() element.Focus(FocusState.Programmatic); } - private async void FileList_ItemTappedAsync(object sender, TappedRoutedEventArgs e) + private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e) { var ctrlPressed = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down); var shiftPressed = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down); diff --git a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml index 360534df522d..51d7389d2185 100644 --- a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml @@ -221,12 +221,12 @@ ItemsSource="{x:Bind CollectionViewSource.View, Mode=OneWay}" Loaded="FileList_Loaded" LosingFocus="FileList_LosingFocus" - PreviewKeyDown="FileList_PreviewKeyDownAsync" + PreviewKeyDown="FileList_PreviewKeyDown" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollMode="Auto" SelectionChanged="FileList_SelectionChanged" SelectionMode="Extended" - Tapped="FileList_ItemTappedAsync" + Tapped="FileList_ItemTapped" Visibility="{x:Bind FolderSettings.IsLayoutModeChanging, Converter={StaticResource NegatedBoolToVisibilityConverter}, Mode=OneWay}"> diff --git a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs index 42495e3457a0..e3a21a0c7523 100644 --- a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs +++ b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs @@ -311,8 +311,8 @@ protected override void EndRename(TextBox textBox) textBlock!.Visibility = Visibility.Visible; } - textBox!.LostFocus -= RenameTextBox_LostFocusAsync; - textBox.KeyDown -= RenameTextBox_KeyDownAsync; + textBox!.LostFocus -= RenameTextBox_LostFocus; + textBox.KeyDown -= RenameTextBox_KeyDown; FileNameTeachingTip.IsOpen = false; IsRenamingItem = false; @@ -320,7 +320,7 @@ protected override void EndRename(TextBox textBox) listViewItem?.Focus(FocusState.Programmatic); } - protected override async void FileList_PreviewKeyDownAsync(object sender, KeyRoutedEventArgs e) + protected override async void FileList_PreviewKeyDown(object sender, KeyRoutedEventArgs e) { if (ParentShellPageInstance is null || IsRenamingItem) return; @@ -421,7 +421,7 @@ private async Task ReloadItemIconsAsync() } } - private async void FileList_ItemTappedAsync(object sender, TappedRoutedEventArgs e) + private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e) { var clickedItem = e.OriginalSource as FrameworkElement; var ctrlPressed = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down); diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml index ce2ea2b366c4..71c6778a9cf0 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml @@ -584,13 +584,13 @@ IsDoubleTapEnabled="True" IsTabStop="True" ItemsSource="{x:Bind CollectionViewSource.View, Mode=OneWay}" - PreviewKeyDown="FileList_PreviewKeyDownAsync" + PreviewKeyDown="FileList_PreviewKeyDown" ScrollViewer.IsHorizontalScrollChainingEnabled="False" SelectionChanged="FileList_SelectionChanged" SelectionMode="Extended" ShowsScrollingPlaceholders="True" StretchContentForSingleRow="False" - Tapped="FileList_ItemTappedAsync"> + Tapped="FileList_ItemTapped"> diff --git a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs index f432c2ea3465..b13e998d6486 100644 --- a/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs +++ b/src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs @@ -205,8 +205,8 @@ override public void StartRenameItem() } textBox.Focus(FocusState.Pointer); - textBox.LostFocus += RenameTextBox_LostFocusAsync; - textBox.KeyDown += RenameTextBox_KeyDownAsync; + textBox.LostFocus += RenameTextBox_LostFocus; + textBox.KeyDown += RenameTextBox_KeyDown; int selectedTextLength = SelectedItem.Name.Length; if (!SelectedItem.IsShortcut && UserSettingsService.FoldersSettingsService.ShowFileExtensions) @@ -250,8 +250,8 @@ protected override void EndRename(TextBox textBox) textBlock!.Visibility = Visibility.Visible; } - textBox!.LostFocus -= RenameTextBox_LostFocusAsync; - textBox.KeyDown -= RenameTextBox_KeyDownAsync; + textBox!.LostFocus -= RenameTextBox_LostFocus; + textBox.KeyDown -= RenameTextBox_KeyDown; FileNameTeachingTip.IsOpen = false; IsRenamingItem = false; @@ -259,7 +259,7 @@ protected override void EndRename(TextBox textBox) gridViewItem?.Focus(FocusState.Programmatic); } - protected override async void FileList_PreviewKeyDownAsync(object sender, KeyRoutedEventArgs e) + protected override async void FileList_PreviewKeyDown(object sender, KeyRoutedEventArgs e) { if (ParentShellPageInstance is null || IsRenamingItem) return; @@ -359,7 +359,7 @@ private async Task ReloadItemIconsAsync() } } - private async void FileList_ItemTappedAsync(object sender, TappedRoutedEventArgs e) + private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e) { var clickedItem = e.OriginalSource as FrameworkElement; var ctrlPressed = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down); diff --git a/src/Files.App/Views/LayoutModes/StandardLayoutMode.cs b/src/Files.App/Views/LayoutModes/StandardLayoutMode.cs index 53ffe9ce80b5..35557fd9604d 100644 --- a/src/Files.App/Views/LayoutModes/StandardLayoutMode.cs +++ b/src/Files.App/Views/LayoutModes/StandardLayoutMode.cs @@ -162,7 +162,7 @@ protected virtual void FileList_SelectionChanged(object sender, SelectionChanged SelectedItems = ListViewBase.SelectedItems.Cast().Where(x => x is not null).ToList(); } - protected abstract void FileList_PreviewKeyDownAsync(object sender, KeyRoutedEventArgs e); + protected abstract void FileList_PreviewKeyDown(object sender, KeyRoutedEventArgs e); protected virtual void SelectionRectangle_SelectionEnded(object? sender, EventArgs e) { @@ -199,8 +199,8 @@ protected virtual void StartRenameItem(string itemNameTextBox) Grid.SetColumnSpan(textBox.FindParent(), 8); textBox.Focus(FocusState.Pointer); - textBox.LostFocus += RenameTextBox_LostFocusAsync; - textBox.KeyDown += RenameTextBox_KeyDownAsync; + textBox.LostFocus += RenameTextBox_LostFocus; + textBox.KeyDown += RenameTextBox_KeyDown; int selectedTextLength = SelectedItem.Name.Length; @@ -221,7 +221,7 @@ protected virtual async Task CommitRenameAsync(TextBox textBox) await UIFilesystemHelpers.RenameFileItemAsync(RenamingItem, newItemName, ParentShellPageInstance); } - protected virtual async void RenameTextBox_LostFocusAsync(object sender, RoutedEventArgs e) + protected virtual async void RenameTextBox_LostFocus(object sender, RoutedEventArgs e) { // This check allows the user to use the text box context menu without ending the rename if (!(FocusManager.GetFocusedElement(XamlRoot) is AppBarButton or Popup)) @@ -231,19 +231,19 @@ protected virtual async void RenameTextBox_LostFocusAsync(object sender, RoutedE } } - protected async void RenameTextBox_KeyDownAsync(object sender, KeyRoutedEventArgs e) + protected async void RenameTextBox_KeyDown(object sender, KeyRoutedEventArgs e) { var textBox = (TextBox)sender; switch (e.Key) { case VirtualKey.Escape: - textBox.LostFocus -= RenameTextBox_LostFocusAsync; + textBox.LostFocus -= RenameTextBox_LostFocus; textBox.Text = OldItemName; EndRename(textBox); e.Handled = true; break; case VirtualKey.Enter: - textBox.LostFocus -= RenameTextBox_LostFocusAsync; + textBox.LostFocus -= RenameTextBox_LostFocus; await CommitRenameAsync(textBox); e.Handled = true; break; @@ -262,7 +262,7 @@ protected async void RenameTextBox_KeyDownAsync(object sender, KeyRoutedEventArg e.Handled = (textBox.SelectionStart + textBox.SelectionLength) == textBox.Text.Length; break; case VirtualKey.Tab: - textBox.LostFocus -= RenameTextBox_LostFocusAsync; + textBox.LostFocus -= RenameTextBox_LostFocus; var isShiftPressed = (GetKeyState((int)VirtualKey.Shift) & KEY_DOWN_MASK) != 0; NextRenameIndex = isShiftPressed ? -1 : 1; diff --git a/src/Files.App/Views/PaneHolderPage.xaml.cs b/src/Files.App/Views/PaneHolderPage.xaml.cs index 220a1364f8cb..197e15120938 100644 --- a/src/Files.App/Views/PaneHolderPage.xaml.cs +++ b/src/Files.App/Views/PaneHolderPage.xaml.cs @@ -323,11 +323,11 @@ public void CloseActivePane() private void Pane_Loaded(object sender, RoutedEventArgs e) { - ((UIElement)sender).GotFocus += Pane_GotFocusAsync; + ((UIElement)sender).GotFocus += Pane_GotFocus; ((UIElement)sender).RightTapped += Pane_RightTapped; } - private async void Pane_GotFocusAsync(object sender, RoutedEventArgs e) + private async void Pane_GotFocus(object sender, RoutedEventArgs e) { var isLeftPane = sender == PaneLeft; if (isLeftPane && (PaneRight?.SlimContentPage?.IsItemSelected ?? false)) diff --git a/src/Files.App/Views/Properties/CompatibilityPage.xaml b/src/Files.App/Views/Properties/CompatibilityPage.xaml index a5623bf176b3..510e8f56ac19 100644 --- a/src/Files.App/Views/Properties/CompatibilityPage.xaml +++ b/src/Files.App/Views/Properties/CompatibilityPage.xaml @@ -9,7 +9,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:settingsuc="using:Files.App.UserControls.Settings" xmlns:vm="using:Files.App.ViewModels.Properties" - Loaded="Properties_LoadedAsync" + Loaded="Properties_Loaded" Tag="Compatibility" mc:Ignorable="d"> diff --git a/src/Files.App/Views/Properties/CompatibilityPage.xaml.cs b/src/Files.App/Views/Properties/CompatibilityPage.xaml.cs index 03739e85c12c..ea8fc16497a7 100644 --- a/src/Files.App/Views/Properties/CompatibilityPage.xaml.cs +++ b/src/Files.App/Views/Properties/CompatibilityPage.xaml.cs @@ -28,9 +28,9 @@ protected override void OnNavigatedTo(NavigationEventArgs e) base.OnNavigatedTo(e); } - protected override void Properties_LoadedAsync(object sender, RoutedEventArgs e) + protected override void Properties_Loaded(object sender, RoutedEventArgs e) { - base.Properties_LoadedAsync(sender, e); + base.Properties_Loaded(sender, e); CompatibilityProperties?.GetCompatibilityOptions(); } diff --git a/src/Files.App/Views/Properties/DetailsPage.xaml b/src/Files.App/Views/Properties/DetailsPage.xaml index 177296cd00bd..224116e49ca2 100644 --- a/src/Files.App/Views/Properties/DetailsPage.xaml +++ b/src/Files.App/Views/Properties/DetailsPage.xaml @@ -8,7 +8,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkitconverters="using:CommunityToolkit.WinUI.UI.Converters" xmlns:vm="using:Files.App.ViewModels.Properties" - Loaded="Properties_LoadedAsync" + Loaded="Properties_Loaded" Tag="Details" mc:Ignorable="d"> @@ -139,7 +139,7 @@