/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Data/Contexts/Window/WindowContext.cs
51 строка
1 KB
yair100
Feature: Added toggle states to toolbar buttons (#18799)
06 авг 2026, 01:39
Не верифицирован
06 авг 2026, 01:39
fb8b286
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. using Microsoft.UI.Windowing; namespace Files.App.Data.Contexts { /// <inheritdoc cref="IWindowContext"/> internal sealed partial class WindowContext : ObservableObject, IWindowContext { private IWindowsSecurityService WindowsSecurityService = Ioc.Default.GetRequiredService<IWindowsSecurityService>(); private bool isCompactOverlay; /// <inheritdoc/> public bool IsCompactOverlay => isCompactOverlay; private bool isFullScreen; /// <inheritdoc/> public bool IsFullScreen => isFullScreen; /// <inheritdoc/> public bool IsRunningAsAdmin { get; private set; } /// <inheritdoc/> public bool CanDragAndDrop { get; private set; } public WindowContext() { IsRunningAsAdmin = WindowsSecurityService.IsAppElevated(); CanDragAndDrop = WindowsSecurityService.CanDragAndDrop(); MainWindow.Instance.AppWindow.Changed += AppWindow_Changed; } private void AppWindow_Changed(AppWindow sender, AppWindowChangedEventArgs args) { if (args.DidPresenterChange) { SetProperty( ref isCompactOverlay, sender.Presenter.Kind is AppWindowPresenterKind.CompactOverlay, nameof(IsCompactOverlay)); SetProperty( ref isFullScreen, sender.Presenter.Kind is AppWindowPresenterKind.FullScreen, nameof(IsFullScreen)); } } } }