Skip to content

Commit 2cd9117

Browse files
committed
ModifiableCommand
1 parent 2ae0d75 commit 2cd9117

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

src/Files.App/Data/Commands/Manager/IModifiableCommandManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ public interface IModifiableCommandManager : IEnumerable<IRichCommand>
1111

1212
IRichCommand PasteItem { get; }
1313
IRichCommand DeleteItem { get; }
14+
IRichCommand OpenProperties { get; }
1415
}
1516
}

src/Files.App/Data/Commands/Manager/ModifiableCommandManager.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License. See the LICENSE.
33

44
using System.Collections.Frozen;
5-
using System.Collections.Immutable;
65

76
namespace Files.App.Data.Commands
87
{
@@ -17,6 +16,7 @@ internal sealed class ModifiableCommandManager : IModifiableCommandManager
1716
public IRichCommand None => ModifiableCommands[CommandCodes.None];
1817
public IRichCommand PasteItem => ModifiableCommands[CommandCodes.PasteItem];
1918
public IRichCommand DeleteItem => ModifiableCommands[CommandCodes.DeleteItem];
19+
public IRichCommand OpenProperties => ModifiableCommands[CommandCodes.OpenProperties];
2020

2121
public ModifiableCommandManager()
2222
{
@@ -35,6 +35,9 @@ public ModifiableCommandManager()
3535
[CommandCodes.DeleteItem] = new ModifiableCommand(Commands.DeleteItem, new() {
3636
{ KeyModifiers.Shift, Commands.DeleteItemPermanently }
3737
}),
38+
[CommandCodes.OpenProperties] = new ModifiableCommand(Commands.OpenProperties, new() {
39+
{ KeyModifiers.Shift, Commands.OpenClassicProperties }
40+
}),
3841
}.ToFrozenDictionary();
3942
}
4043
}

src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,10 @@ public static List<ContextMenuFlyoutItemViewModel> GetBaseItemMenuItems(
490490
IsVisible = itemsSelected,
491491
IsPrimary = true,
492492
}.Build(),
493-
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenProperties)
493+
new ContextMenuFlyoutItemViewModelBuilder(ModifiableCommands.OpenProperties)
494494
{
495495
IsPrimary = true,
496-
IsVisible = Commands.OpenProperties.IsExecutable
496+
IsVisible = ModifiableCommands.OpenProperties.IsExecutable
497497
}.Build(),
498498
new ContextMenuFlyoutItemViewModelBuilder(Commands.OpenParentFolder).Build(),
499499
new ContextMenuFlyoutItemViewModelBuilder(Commands.PinFolderToSidebar)

src/Files.App/UserControls/InnerNavigationToolbar.xaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@
243243
AccessKey="O"
244244
AccessKeyInvoked="AppBarButton_AccessKeyInvoked"
245245
AutomationProperties.AutomationId="InnerNavigationToolbarPropertiesButton"
246-
Command="{x:Bind Commands.OpenProperties, Mode=OneWay}"
247-
IsEnabled="{x:Bind Commands.OpenProperties.IsExecutable, Mode=OneWay}"
248-
KeyboardAcceleratorTextOverride="{x:Bind Commands.OpenProperties.HotKeyText, Mode=OneWay}"
249-
Label="{x:Bind Commands.OpenProperties.Label}"
246+
Command="{x:Bind ModifiableCommands.OpenProperties, Mode=OneWay}"
247+
IsEnabled="{x:Bind ModifiableCommands.OpenProperties.IsExecutable, Mode=OneWay}"
248+
KeyboardAcceleratorTextOverride="{x:Bind ModifiableCommands.OpenProperties.HotKeyText, Mode=OneWay}"
249+
Label="{x:Bind ModifiableCommands.OpenProperties.Label}"
250250
LabelPosition="Collapsed"
251-
ToolTipService.ToolTip="{x:Bind Commands.OpenProperties.LabelWithHotKey, Mode=OneWay}">
252-
<controls:ThemedIcon Style="{x:Bind Commands.OpenProperties.ThemedIconStyle, Mode=OneTime}" />
251+
ToolTipService.ToolTip="{x:Bind ModifiableCommands.OpenProperties.LabelWithHotKey, Mode=OneWay}">
252+
<controls:ThemedIcon Style="{x:Bind ModifiableCommands.OpenProperties.ThemedIconStyle, Mode=OneTime}" />
253253
</AppBarButton>
254254

255255
<!-- (Divider) -->

0 commit comments

Comments
 (0)