/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/Show/ToggleShelfPaneAction.cs
52 строки
1 KB
yair100
Code Quality: Add Category, ExtendedLabel, AutomationId and AccessKey to actions (#18308)
27 мар 2026, 00:40
Не верифицирован
27 мар 2026, 00:40
6ef1f17
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. namespace Files.App.Actions { [GeneratedRichCommand] internal sealed partial class ToggleShelfPaneAction : ObservableObject, IToggleAction { private readonly IGeneralSettingsService generalSettingsService = Ioc.Default.GetRequiredService<IGeneralSettingsService>(); public string Label => Strings.ToggleShelfPane.GetLocalizedResource(); public string Description => Strings.ToggleShelfPaneDescription.GetLocalizedResource(); public ActionCategory Category => ActionCategory.Show; public RichGlyph Glyph => new(themedIconStyle: "App.ThemedIcons.Shelf"); // TODO Remove IsAccessibleGlobally when shelf feature is ready public bool IsAccessibleGlobally => AppLifecycleHelper.AppEnvironment is AppEnvironment.Dev; // TODO Remove IsExecutable when shelf feature is ready public bool IsExecutable => AppLifecycleHelper.AppEnvironment is AppEnvironment.Dev; public bool IsOn => generalSettingsService.ShowShelfPane; public ToggleShelfPaneAction() { generalSettingsService.PropertyChanged += GeneralSettingsService_PropertyChanged; } public Task ExecuteAsync(object? parameter = null) { generalSettingsService.ShowShelfPane = !IsOn; return Task.CompletedTask; } private void GeneralSettingsService_PropertyChanged(object? sender, PropertyChangedEventArgs e) { if (e.PropertyName is nameof(GeneralSettingsService.ShowShelfPane)) OnPropertyChanged(nameof(IsOn)); } } }