33
44namespace Files . App . Actions
55{
6- internal sealed class ToggleDetailsPaneAction : ObservableObject , IToggleAction
6+ internal sealed class ToggleDetailsPaneAction : ObservableObject , IAction
77 {
8- private readonly InfoPaneViewModel viewModel ;
8+ private readonly InfoPaneViewModel infoPaneViewModel = Ioc . Default . GetRequiredService < InfoPaneViewModel > ( ) ;
99 private readonly IInfoPaneSettingsService infoPaneSettingsService = Ioc . Default . GetRequiredService < IInfoPaneSettingsService > ( ) ;
1010
1111 public string Label
12- => " ToggleDetailsPane" . GetLocalizedResource ( ) ;
12+ => Strings . ToggleDetailsPane . GetLocalizedResource ( ) ;
1313
1414 public string Description
15- => " ToggleDetailsPaneDescription" . GetLocalizedResource ( ) ;
15+ => Strings . ToggleDetailsPaneDescription . GetLocalizedResource ( ) ;
1616
1717 public RichGlyph Glyph
1818 => new ( themedIconStyle : "App.ThemedIcons.PanelRight" ) ;
1919
20- public HotKey HotKey
21- => new ( Keys . D , KeyModifiers . CtrlAlt ) ;
20+ public bool IsAccessibleGlobally
21+ => false ;
2222
23- public bool IsOn
24- => viewModel . IsEnabled ;
23+ public bool IsExecutable
24+ => infoPaneViewModel . IsEnabled ;
2525
2626 public ToggleDetailsPaneAction ( )
2727 {
28- viewModel = Ioc . Default . GetRequiredService < InfoPaneViewModel > ( ) ;
29- viewModel . PropertyChanged += ViewModel_PropertyChanged ;
28+ infoPaneViewModel . PropertyChanged += ViewModel_PropertyChanged ;
3029 }
3130
3231 public Task ExecuteAsync ( object ? parameter = null )
3332 {
34- viewModel . IsEnabled = true ;
3533 infoPaneSettingsService . SelectedTab = InfoPaneTabs . Details ;
3634
3735 return Task . CompletedTask ;
@@ -40,7 +38,7 @@ public Task ExecuteAsync(object? parameter = null)
4038 private void ViewModel_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
4139 {
4240 if ( e . PropertyName is nameof ( InfoPaneViewModel . IsEnabled ) )
43- OnPropertyChanged ( nameof ( IsOn ) ) ;
41+ OnPropertyChanged ( nameof ( IsExecutable ) ) ;
4442 }
4543 }
4644}
0 commit comments