/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/Show/ToggleShowFileExtensionsAction.cs
43 строки
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 ToggleShowFileExtensionsAction : ObservableObject, IToggleAction { private readonly IFoldersSettingsService settings; public string Label => Strings.ShowFileExtensions.GetLocalizedResource(); public string Description => Strings.ToggleShowFileExtensionsDescription.GetLocalizedResource(); public ActionCategory Category => ActionCategory.Show; public bool IsOn => settings.ShowFileExtensions; public ToggleShowFileExtensionsAction() { settings = Ioc.Default.GetRequiredService<IFoldersSettingsService>(); settings.PropertyChanged += Settings_PropertyChanged; } public Task ExecuteAsync(object? parameter = null) { settings.ShowFileExtensions = !settings.ShowFileExtensions; return Task.CompletedTask; } private void Settings_PropertyChanged(object? sender, PropertyChangedEventArgs e) { if (e.PropertyName is nameof(IFoldersSettingsService.ShowFileExtensions)) OnPropertyChanged(nameof(IsOn)); } } }