/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/Content/Background/SetAsLockscreenBackgroundAction.cs
45 строк
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 SetAsLockscreenBackgroundAction : BaseSetAsAction { public override string Label => Strings.Lockscreen.GetLocalizedResource(); public override string ExtendedLabel => Strings.SetAsLockscreen.GetLocalizedResource(); public override string Description => Strings.SetAsLockscreenBackgroundDescription.GetLocalizedResource(); public string AccessKey => "L"; public override RichGlyph Glyph => new("\uEE3F"); public override bool IsExecutable => base.IsExecutable && ContentPageContext.SelectedItem is not null; public override Task ExecuteAsync(object? parameter = null) { if (!IsExecutable || ContentPageContext.SelectedItem is not ListedItem selectedItem) return Task.CompletedTask; try { return WindowsWallpaperService.SetLockScreenWallpaper(selectedItem.ItemPath); } catch (Exception ex) { ShowErrorDialog(ex.Message); return Task.CompletedTask; } } } }