From 7282b4785e1daac1e2d6dd730391b7841abf422a Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:51:39 -0500 Subject: [PATCH] Code Quality: Replace 'Format Drive' commands with actions (#16468) --- .../Actions/FileSystem/FormatDriveAction.cs | 28 +++++++-------- .../FileSystem/FormatDriveFromHomeAction.cs | 29 +++++++++++++++ .../FormatDriveFromSidebarAction.cs | 29 +++++++++++++++ .../Data/Commands/Manager/CommandCodes.cs | 2 ++ .../Data/Commands/Manager/CommandManager.cs | 4 +++ .../Data/Commands/Manager/ICommandManager.cs | 2 ++ .../Data/Contracts/INavigationControlItem.cs | 2 -- src/Files.App/Data/Items/DriveItem.cs | 1 - .../UserControls/SidebarViewModel.cs | 18 ++-------- .../Widgets/DrivesWidgetViewModel.cs | 35 ++++++------------- .../NetworkLocationsWidgetViewModel.cs | 30 ++++++---------- 11 files changed, 104 insertions(+), 76 deletions(-) create mode 100644 src/Files.App/Actions/FileSystem/FormatDriveFromHomeAction.cs create mode 100644 src/Files.App/Actions/FileSystem/FormatDriveFromSidebarAction.cs diff --git a/src/Files.App/Actions/FileSystem/FormatDriveAction.cs b/src/Files.App/Actions/FileSystem/FormatDriveAction.cs index c8d555bb8081..3d2628a4bf4b 100644 --- a/src/Files.App/Actions/FileSystem/FormatDriveAction.cs +++ b/src/Files.App/Actions/FileSystem/FormatDriveAction.cs @@ -1,37 +1,37 @@ // Copyright (c) 2024 Files Community // Licensed under the MIT License. See the LICENSE. -using Files.App.Utils.Shell; - namespace Files.App.Actions { - internal sealed class FormatDriveAction : ObservableObject, IAction + internal class FormatDriveAction : ObservableObject, IAction { - private readonly IContentPageContext context; + private readonly IContentPageContext context = Ioc.Default.GetRequiredService(); - private readonly DrivesViewModel drivesViewModel; + private readonly DrivesViewModel drivesViewModel = Ioc.Default.GetRequiredService(); public string Label - => "FormatDriveText".GetLocalizedResource(); + => Strings.FormatDriveText.GetLocalizedResource(); public string Description - => "FormatDriveDescription".GetLocalizedResource(); + => Strings.FormatDriveDescription.GetLocalizedResource(); - public bool IsExecutable => + public virtual bool IsExecutable => context.HasItem && !context.HasSelection && - (drivesViewModel.Drives.Cast().FirstOrDefault(x => - string.Equals(x.Path, context.Folder?.ItemPath))?.MenuOptions.ShowFormatDrive ?? false); + drivesViewModel.Drives + .Cast() + .FirstOrDefault(x => string.Equals(x.Path, context.Folder?.ItemPath)) is DriveItem driveItem && + !(driveItem.Type == DriveType.Network || string.Equals(context.Folder?.ItemPath, $@"{Constants.UserEnvironmentPaths.SystemDrivePath}\", StringComparison.OrdinalIgnoreCase)); + + public virtual bool IsAccessibleGlobally + => true; public FormatDriveAction() { - context = Ioc.Default.GetRequiredService(); - drivesViewModel = Ioc.Default.GetRequiredService(); - context.PropertyChanged += Context_PropertyChanged; } - public Task ExecuteAsync(object? parameter = null) + public virtual Task ExecuteAsync(object? parameter = null) { return Win32Helper.OpenFormatDriveDialog(context.Folder?.ItemPath ?? string.Empty); } diff --git a/src/Files.App/Actions/FileSystem/FormatDriveFromHomeAction.cs b/src/Files.App/Actions/FileSystem/FormatDriveFromHomeAction.cs new file mode 100644 index 000000000000..f727e054ff5c --- /dev/null +++ b/src/Files.App/Actions/FileSystem/FormatDriveFromHomeAction.cs @@ -0,0 +1,29 @@ +// Copyright (c) 2024 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.App.Actions +{ + internal sealed class FormatDriveFromHomeAction : FormatDriveAction + { + private IHomePageContext HomePageContext { get; } = Ioc.Default.GetRequiredService(); + + private readonly DrivesViewModel drivesViewModel = Ioc.Default.GetRequiredService(); + + public override bool IsExecutable => + HomePageContext.IsAnyItemRightClicked && + HomePageContext.RightClickedItem is not null && + HomePageContext.RightClickedItem.Path is not null && + drivesViewModel.Drives + .Cast() + .FirstOrDefault(x => string.Equals(x.Path, HomePageContext.RightClickedItem.Path)) is DriveItem driveItem && + !(driveItem.Type == DriveType.Network || string.Equals(HomePageContext.RightClickedItem.Path, $@"{Constants.UserEnvironmentPaths.SystemDrivePath}\", StringComparison.OrdinalIgnoreCase)); + + public override bool IsAccessibleGlobally + => false; + + public override Task ExecuteAsync(object? parameter = null) + { + return Win32Helper.OpenFormatDriveDialog(HomePageContext?.RightClickedItem?.Path ?? string.Empty); + } + } +} \ No newline at end of file diff --git a/src/Files.App/Actions/FileSystem/FormatDriveFromSidebarAction.cs b/src/Files.App/Actions/FileSystem/FormatDriveFromSidebarAction.cs new file mode 100644 index 000000000000..c4fc92e9bf31 --- /dev/null +++ b/src/Files.App/Actions/FileSystem/FormatDriveFromSidebarAction.cs @@ -0,0 +1,29 @@ +// Copyright (c) 2024 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.App.Actions +{ + internal sealed class FormatDriveFromSidebarAction : FormatDriveAction + { + private ISidebarContext SidebarContext { get; } = Ioc.Default.GetRequiredService(); + + private readonly DrivesViewModel drivesViewModel = Ioc.Default.GetRequiredService(); + + public override bool IsExecutable => + SidebarContext.IsItemRightClicked && + SidebarContext.RightClickedItem is not null && + SidebarContext.RightClickedItem.Path is not null && + drivesViewModel.Drives + .Cast() + .FirstOrDefault(x => string.Equals(x.Path, SidebarContext.RightClickedItem.Path)) is DriveItem driveItem && + !(driveItem.Type == DriveType.Network || string.Equals(SidebarContext.RightClickedItem.Path, $@"{Constants.UserEnvironmentPaths.SystemDrivePath}\", StringComparison.OrdinalIgnoreCase)); + + public override bool IsAccessibleGlobally + => false; + + public override Task ExecuteAsync(object? parameter = null) + { + return Win32Helper.OpenFormatDriveDialog(SidebarContext?.RightClickedItem?.Path ?? string.Empty); + } + } +} \ No newline at end of file diff --git a/src/Files.App/Data/Commands/Manager/CommandCodes.cs b/src/Files.App/Data/Commands/Manager/CommandCodes.cs index 58e6b57097ed..ff12af5d2b06 100644 --- a/src/Files.App/Data/Commands/Manager/CommandCodes.cs +++ b/src/Files.App/Data/Commands/Manager/CommandCodes.cs @@ -47,6 +47,8 @@ public enum CommandCodes CreateShortcutFromDialog, EmptyRecycleBin, FormatDrive, + FormatDriveFromHome, + FormatDriveFromSidebar, RestoreRecycleBin, RestoreAllRecycleBin, OpenItem, diff --git a/src/Files.App/Data/Commands/Manager/CommandManager.cs b/src/Files.App/Data/Commands/Manager/CommandManager.cs index a4711d2c0127..b79f43500eb6 100644 --- a/src/Files.App/Data/Commands/Manager/CommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/CommandManager.cs @@ -179,6 +179,8 @@ public IRichCommand this[HotKey hotKey] public IRichCommand NewWindow => commands[CommandCodes.NewWindow]; public IRichCommand NewTab => commands[CommandCodes.NewTab]; public IRichCommand FormatDrive => commands[CommandCodes.FormatDrive]; + public IRichCommand FormatDriveFromHome => commands[CommandCodes.FormatDriveFromHome]; + public IRichCommand FormatDriveFromSidebar => commands[CommandCodes.FormatDriveFromSidebar]; public IRichCommand NavigateBack => commands[CommandCodes.NavigateBack]; public IRichCommand NavigateForward => commands[CommandCodes.NavigateForward]; public IRichCommand NavigateUp => commands[CommandCodes.NavigateUp]; @@ -379,6 +381,8 @@ public IEnumerator GetEnumerator() => [CommandCodes.NewWindow] = new NewWindowAction(), [CommandCodes.NewTab] = new NewTabAction(), [CommandCodes.FormatDrive] = new FormatDriveAction(), + [CommandCodes.FormatDriveFromHome] = new FormatDriveFromHomeAction(), + [CommandCodes.FormatDriveFromSidebar] = new FormatDriveFromSidebarAction(), [CommandCodes.NavigateBack] = new NavigateBackAction(), [CommandCodes.NavigateForward] = new NavigateForwardAction(), [CommandCodes.NavigateUp] = new NavigateUpAction(), diff --git a/src/Files.App/Data/Commands/Manager/ICommandManager.cs b/src/Files.App/Data/Commands/Manager/ICommandManager.cs index f33e0c7f4544..1f46a14f0822 100644 --- a/src/Files.App/Data/Commands/Manager/ICommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/ICommandManager.cs @@ -58,6 +58,8 @@ public interface ICommandManager : IEnumerable IRichCommand RestoreRecycleBin { get; } IRichCommand RestoreAllRecycleBin { get; } IRichCommand FormatDrive { get; } + IRichCommand FormatDriveFromHome { get; } + IRichCommand FormatDriveFromSidebar { get; } IRichCommand OpenItem { get; } IRichCommand OpenItemWithApplicationPicker { get; } IRichCommand OpenParentFolder { get; } diff --git a/src/Files.App/Data/Contracts/INavigationControlItem.cs b/src/Files.App/Data/Contracts/INavigationControlItem.cs index 80dfb5fd2f5b..82ce24d872ca 100644 --- a/src/Files.App/Data/Contracts/INavigationControlItem.cs +++ b/src/Files.App/Data/Contracts/INavigationControlItem.cs @@ -54,8 +54,6 @@ public sealed class ContextMenuOptions public bool ShowEjectDevice { get; set; } - public bool ShowFormatDrive { get; set; } - public bool ShowShellItems { get; set; } } } diff --git a/src/Files.App/Data/Items/DriveItem.cs b/src/Files.App/Data/Items/DriveItem.cs index 95c8d3f3db9c..46793728ab4c 100644 --- a/src/Files.App/Data/Items/DriveItem.cs +++ b/src/Files.App/Data/Items/DriveItem.cs @@ -239,7 +239,6 @@ public static async Task CreateFromPropertiesAsync(StorageFolder root IsLocationItem = true, ShowEjectDevice = item.IsRemovable, ShowShellItems = true, - ShowFormatDrive = !(item.Type == DriveType.Network || string.Equals(root.Path, $@"{Constants.UserEnvironmentPaths.SystemDrivePath}\", StringComparison.OrdinalIgnoreCase)), ShowProperties = true }; item.Path = string.IsNullOrEmpty(root.Path) ? $"\\\\?\\{root.Name}\\" : root.Path; diff --git a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs index d9d1dea92a41..a61529f9df85 100644 --- a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs @@ -258,7 +258,6 @@ public SidebarViewModel() OpenInNewWindowCommand = new AsyncRelayCommand(OpenInNewWindowAsync); OpenInNewPaneCommand = new AsyncRelayCommand(OpenInNewPaneAsync); EjectDeviceCommand = new RelayCommand(EjectDevice); - FormatDriveCommand = new RelayCommand(FormatDrive); OpenPropertiesCommand = new RelayCommand(OpenProperties); ReorderItemsCommand = new AsyncRelayCommand(ReorderItemsAsync); } @@ -839,8 +838,6 @@ public async void HandleItemInvokedAsync(object item, PointerUpdateKind pointerU private ICommand EjectDeviceCommand { get; } - private ICommand FormatDriveCommand { get; } - private ICommand OpenPropertiesCommand { get; } private ICommand ReorderItemsCommand { get; } @@ -955,11 +952,6 @@ private void EjectDevice() DriveHelpers.EjectDeviceAsync(rightClickedItem.Path); } - private void FormatDrive() - { - Win32Helper.OpenFormatDriveDialog(rightClickedItem.Path); - } - private List GetLocationItemMenuItems(INavigationControlItem item, CommandBarFlyout menu) { var options = item.MenuOptions; @@ -1058,17 +1050,11 @@ private List GetLocationItemMenuItems(INavigatio ItemType = ContextMenuFlyoutItemType.Separator, ShowItem = Commands.OpenTerminalFromSidebar.IsExecutable || Commands.OpenStorageSenseFromSidebar.IsExecutable || - options.ShowFormatDrive + Commands.FormatDriveFromSidebar.IsExecutable }, new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenTerminalFromSidebar).Build(), new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenStorageSenseFromSidebar).Build(), - new ContextMenuFlyoutItemViewModel() - { - Text = Strings.FormatDriveText.GetLocalizedResource(), - Command = FormatDriveCommand, - CommandParameter = item, - ShowItem = options.ShowFormatDrive - }, + new ContextMenuFlyoutItemViewModelBuilder(Commands.FormatDriveFromSidebar).Build(), new ContextMenuFlyoutItemViewModel() { ItemType = ContextMenuFlyoutItemType.Separator, diff --git a/src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs b/src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs index 3853923c46b7..508ea5ac9283 100644 --- a/src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs @@ -20,15 +20,14 @@ public sealed class DrivesWidgetViewModel : BaseWidgetViewModel, IWidgetViewMode public ObservableCollection Items { get; } = []; public string WidgetName => nameof(DrivesWidget); - public string AutomationProperties => "Drives".GetLocalizedResource(); - public string WidgetHeader => "Drives".GetLocalizedResource(); + public string AutomationProperties => Strings.Drives.GetLocalizedResource(); + public string WidgetHeader => Strings.Drives.GetLocalizedResource(); public bool IsWidgetSettingEnabled => UserSettingsService.GeneralSettingsService.ShowDrivesWidget; public bool ShowMenuFlyout => false; public MenuFlyoutItem? MenuFlyoutItem => null; // Commands - private ICommand FormatDriveCommand { get; } = null!; private ICommand EjectDeviceCommand { get; } = null!; private ICommand OpenInNewPaneCommand { get; } = null!; private ICommand DisconnectNetworkDriveCommand { get; } = null!; @@ -45,7 +44,6 @@ public DrivesWidgetViewModel() OpenInNewWindowCommand = new AsyncRelayCommand(ExecuteOpenInNewWindowCommand); PinToSidebarCommand = new AsyncRelayCommand(ExecutePinToSidebarCommand); UnpinFromSidebarCommand = new AsyncRelayCommand(ExecuteUnpinFromSidebarCommand); - FormatDriveCommand = new RelayCommand(ExecuteFormatDriveCommand); EjectDeviceCommand = new RelayCommand(ExecuteEjectDeviceCommand); OpenInNewPaneCommand = new AsyncRelayCommand(ExecuteOpenInNewPaneCommand); OpenPropertiesCommand = new RelayCommand(ExecuteOpenPropertiesCommand); @@ -99,7 +97,7 @@ public override List GetItemMenuItems(WidgetCard new ContextMenuFlyoutItemViewModelBuilder(CommandManager.OpenInNewPaneFromHomeAction).Build(), new() { - Text = "PinFolderToSidebar".GetLocalizedResource(), + Text = Strings.PinFolderToSidebar.GetLocalizedResource(), ThemedIconModel = new ThemedIconModel() { ThemedIconStyle = "App.ThemedIcons.FavoritePin" }, Command = PinToSidebarCommand, CommandParameter = item, @@ -107,7 +105,7 @@ public override List GetItemMenuItems(WidgetCard }, new() { - Text = "UnpinFolderFromSidebar".GetLocalizedResource(), + Text = Strings.UnpinFolderFromSidebar.GetLocalizedResource(), ThemedIconModel = new ThemedIconModel() { ThemedIconStyle = "App.ThemedIcons.FavoritePinRemove" }, Command = UnpinFromSidebarCommand, CommandParameter = item, @@ -115,27 +113,27 @@ public override List GetItemMenuItems(WidgetCard }, new() { - Text = "Eject".GetLocalizedResource(), + Text = Strings.Eject.GetLocalizedResource(), Command = EjectDeviceCommand, CommandParameter = item, ShowItem = options?.ShowEjectDevice ?? false }, new() { - Text = "Properties".GetLocalizedResource(), + Text = Strings.Properties.GetLocalizedResource(), ThemedIconModel = new ThemedIconModel() { ThemedIconStyle = "App.ThemedIcons.Properties" }, Command = OpenPropertiesCommand, CommandParameter = item }, new() { - Text = "TurnOnBitLocker".GetLocalizedResource(), + Text = Strings.TurnOnBitLocker.GetLocalizedResource(), Tag = "TurnOnBitLockerPlaceholder", IsEnabled = false }, new() { - Text = "ManageBitLocker".GetLocalizedResource(), + Text = Strings.ManageBitLocker.GetLocalizedResource(), Tag = "ManageBitLockerPlaceholder", IsEnabled = false }, @@ -144,17 +142,11 @@ public override List GetItemMenuItems(WidgetCard ItemType = ContextMenuFlyoutItemType.Separator, ShowItem = CommandManager.OpenTerminalFromHome.IsExecutable || CommandManager.OpenStorageSenseFromHome.IsExecutable || - (options?.ShowFormatDrive ?? false) + CommandManager.FormatDriveFromHome.IsExecutable }, new ContextMenuFlyoutItemViewModelBuilder(CommandManager.OpenTerminalFromHome).Build(), new ContextMenuFlyoutItemViewModelBuilder(CommandManager.OpenStorageSenseFromHome).Build(), - new() - { - Text = "FormatDriveText".GetLocalizedResource(), - Command = FormatDriveCommand, - CommandParameter = item, - ShowItem = options?.ShowFormatDrive ?? false - }, + new ContextMenuFlyoutItemViewModelBuilder(CommandManager.FormatDriveFromHome).Build(), new() { ItemType = ContextMenuFlyoutItemType.Separator, @@ -162,7 +154,7 @@ public override List GetItemMenuItems(WidgetCard }, new() { - Text = "Loading".GetLocalizedResource(), + Text = Strings.Loading.GetLocalizedResource(), Glyph = "\xE712", Items = [], ID = "ItemOverflow", @@ -190,11 +182,6 @@ private async Task ExecuteOpenInNewPaneCommand(WidgetDriveCardItem? item) ContentPageContext.ShellPage!.PaneHolder?.OpenSecondaryPane(item.Item.Path); } - private void ExecuteFormatDriveCommand(WidgetDriveCardItem? item) - { - Win32Helper.OpenFormatDriveDialog(item?.Path ?? string.Empty); - } - private void ExecuteOpenPropertiesCommand(WidgetDriveCardItem? item) { if (!HomePageContext.IsAnyItemRightClicked || item is null) diff --git a/src/Files.App/ViewModels/UserControls/Widgets/NetworkLocationsWidgetViewModel.cs b/src/Files.App/ViewModels/UserControls/Widgets/NetworkLocationsWidgetViewModel.cs index 1843fbf88f6c..25e3daa4c489 100644 --- a/src/Files.App/ViewModels/UserControls/Widgets/NetworkLocationsWidgetViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/Widgets/NetworkLocationsWidgetViewModel.cs @@ -40,7 +40,6 @@ public bool IsNoNetworkLocations // Commands - private ICommand FormatDriveCommand { get; } = null!; private ICommand EjectDeviceCommand { get; } = null!; private ICommand OpenInNewPaneCommand { get; } = null!; private ICommand MapNetworkDriveCommand { get; } = null!; @@ -60,7 +59,6 @@ public NetworkLocationsWidgetViewModel() OpenInNewWindowCommand = new AsyncRelayCommand(ExecuteOpenInNewWindowCommand); PinToSidebarCommand = new AsyncRelayCommand(ExecutePinToSidebarCommand); UnpinFromSidebarCommand = new AsyncRelayCommand(ExecuteUnpinFromSidebarCommand); - FormatDriveCommand = new RelayCommand(ExecuteFormatDriveCommand); EjectDeviceCommand = new RelayCommand(ExecuteEjectDeviceCommand); OpenInNewPaneCommand = new AsyncRelayCommand(ExecuteOpenInNewPaneCommand); OpenPropertiesCommand = new RelayCommand(ExecuteOpenPropertiesCommand); @@ -109,7 +107,7 @@ public override List GetItemMenuItems(WidgetCard { new() { - Text = "OpenInNewTab".GetLocalizedResource(), + Text = Strings.OpenInNewTab.GetLocalizedResource(), ThemedIconModel = new ThemedIconModel() { ThemedIconStyle = "App.ThemedIcons.OpenInTab" }, Command = OpenInNewTabCommand, CommandParameter = item, @@ -117,7 +115,7 @@ public override List GetItemMenuItems(WidgetCard }, new() { - Text = "OpenInNewWindow".GetLocalizedResource(), + Text = Strings.OpenInNewWindow.GetLocalizedResource(), ThemedIconModel = new ThemedIconModel() { ThemedIconStyle = "App.ThemedIcons.OpenInWindow" }, Command = OpenInNewWindowCommand, CommandParameter = item, @@ -125,14 +123,14 @@ public override List GetItemMenuItems(WidgetCard }, new() { - Text = "OpenInNewPane".GetLocalizedResource(), + Text = Strings.OpenInNewPane.GetLocalizedResource(), Command = OpenInNewPaneCommand, CommandParameter = item, ShowItem = UserSettingsService.GeneralSettingsService.ShowOpenInNewPane }, new() { - Text = "PinFolderToSidebar".GetLocalizedResource(), + Text = Strings.PinFolderToSidebar.GetLocalizedResource(), ThemedIconModel = new ThemedIconModel() { ThemedIconStyle = "App.ThemedIcons.FavoritePin" }, Command = PinToSidebarCommand, CommandParameter = item, @@ -140,7 +138,7 @@ public override List GetItemMenuItems(WidgetCard }, new() { - Text = "UnpinFolderFromSidebar".GetLocalizedResource(), + Text = Strings.UnpinFolderFromSidebar.GetLocalizedResource(), ThemedIconModel = new ThemedIconModel() { ThemedIconStyle = "App.ThemedIcons.FavoritePinRemove" }, Command = UnpinFromSidebarCommand, CommandParameter = item, @@ -148,34 +146,28 @@ public override List GetItemMenuItems(WidgetCard }, new() { - Text = "Eject".GetLocalizedResource(), + Text = Strings.Eject.GetLocalizedResource(), Command = EjectDeviceCommand, CommandParameter = item, ShowItem = options?.ShowEjectDevice ?? false }, + new ContextMenuFlyoutItemViewModelBuilder(CommandManager.FormatDriveFromHome).Build(), new() { - Text = "FormatDriveText".GetLocalizedResource(), - Command = FormatDriveCommand, - CommandParameter = item, - ShowItem = options?.ShowFormatDrive ?? false - }, - new() - { - Text = "Properties".GetLocalizedResource(), + Text = Strings.Properties.GetLocalizedResource(), ThemedIconModel = new ThemedIconModel() { ThemedIconStyle = "App.ThemedIcons.Properties" }, Command = OpenPropertiesCommand, CommandParameter = item }, new() { - Text = "TurnOnBitLocker".GetLocalizedResource(), + Text = Strings.TurnOnBitLocker.GetLocalizedResource(), Tag = "TurnOnBitLockerPlaceholder", IsEnabled = false }, new() { - Text = "ManageBitLocker".GetLocalizedResource(), + Text = Strings.ManageBitLocker.GetLocalizedResource(), Tag = "ManageBitLockerPlaceholder", IsEnabled = false }, @@ -186,7 +178,7 @@ public override List GetItemMenuItems(WidgetCard }, new() { - Text = "Loading".GetLocalizedResource(), + Text = Strings.Loading.GetLocalizedResource(), Glyph = "\xE712", Items = [], ID = "ItemOverflow",