3
3
4
4
namespace Files . App . Actions
5
5
{
6
- internal sealed class ToggleDetailsPaneAction : ObservableObject , IToggleAction
6
+ internal sealed class ToggleDetailsPaneAction : ObservableObject , IAction
7
7
{
8
- private readonly InfoPaneViewModel viewModel ;
8
+ private readonly InfoPaneViewModel infoPaneViewModel = Ioc . Default . GetRequiredService < InfoPaneViewModel > ( ) ;
9
9
private readonly IInfoPaneSettingsService infoPaneSettingsService = Ioc . Default . GetRequiredService < IInfoPaneSettingsService > ( ) ;
10
10
11
11
public string Label
12
- => " ToggleDetailsPane" . GetLocalizedResource ( ) ;
12
+ => Strings . ToggleDetailsPane . GetLocalizedResource ( ) ;
13
13
14
14
public string Description
15
- => " ToggleDetailsPaneDescription" . GetLocalizedResource ( ) ;
15
+ => Strings . ToggleDetailsPaneDescription . GetLocalizedResource ( ) ;
16
16
17
17
public RichGlyph Glyph
18
18
=> new ( themedIconStyle : "App.ThemedIcons.PanelRight" ) ;
19
19
20
- public HotKey HotKey
21
- => new ( Keys . D , KeyModifiers . CtrlAlt ) ;
20
+ public bool IsAccessibleGlobally
21
+ => false ;
22
22
23
- public bool IsOn
24
- => viewModel . IsEnabled ;
23
+ public bool IsExecutable
24
+ => infoPaneViewModel . IsEnabled ;
25
25
26
26
public ToggleDetailsPaneAction ( )
27
27
{
28
- viewModel = Ioc . Default . GetRequiredService < InfoPaneViewModel > ( ) ;
29
- viewModel . PropertyChanged += ViewModel_PropertyChanged ;
28
+ infoPaneViewModel . PropertyChanged += ViewModel_PropertyChanged ;
30
29
}
31
30
32
31
public Task ExecuteAsync ( object ? parameter = null )
33
32
{
34
- viewModel . IsEnabled = true ;
35
33
infoPaneSettingsService . SelectedTab = InfoPaneTabs . Details ;
36
34
37
35
return Task . CompletedTask ;
@@ -40,7 +38,7 @@ public Task ExecuteAsync(object? parameter = null)
40
38
private void ViewModel_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
41
39
{
42
40
if ( e . PropertyName is nameof ( InfoPaneViewModel . IsEnabled ) )
43
- OnPropertyChanged ( nameof ( IsOn ) ) ;
41
+ OnPropertyChanged ( nameof ( IsExecutable ) ) ;
44
42
}
45
43
}
46
44
}
0 commit comments