/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Actions/Navigation/SplitPaneHorizontallyAction.cs
53 строки
2 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 SplitPaneHorizontallyAction : ObservableObject, IAction { private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>(); public string Label => Strings.SplitPaneHorizontally.GetLocalizedResource(); public string Description => Strings.SplitPaneHorizontallyDescription.GetLocalizedResource(); public ActionCategory Category => ActionCategory.DualPane; public HotKey HotKey => new(Keys.H, KeyModifiers.AltShift); public RichGlyph Glyph => new(themedIconStyle: "App.ThemedIcons.Panes.Horizontal"); public bool IsExecutable => ContentPageContext.IsMultiPaneAvailable && !ContentPageContext.IsMultiPaneActive; public SplitPaneHorizontallyAction() { ContentPageContext.PropertyChanged += ContentPageContext_PropertyChanged; } public Task ExecuteAsync(object? parameter = null) { ContentPageContext.ShellPage!.PaneHolder.OpenSecondaryPane(ContentPageContext.ShellPage!.ShellViewModel.WorkingDirectory, ShellPaneArrangement.Horizontal); return Task.CompletedTask; } private void ContentPageContext_PropertyChanged(object? sender, PropertyChangedEventArgs e) { switch (e.PropertyName) { case nameof(IContentPageContext.IsMultiPaneAvailable): case nameof(IContentPageContext.IsMultiPaneActive): OnPropertyChanged(nameof(IsExecutable)); break; } } } }