|
1 |
| -using System; |
2 |
| -using System.Linq; |
| 1 | +using AtlasToolbox.Utils; |
| 2 | +using AtlasToolbox.ViewModels; |
| 3 | +using AtlasToolbox.Views; |
| 4 | +using CommunityToolkit.Mvvm.Input; |
| 5 | +using CommunityToolkit.WinUI; |
| 6 | +using Microsoft.Extensions.DependencyInjection; |
| 7 | +using Microsoft.UI.Windowing; |
3 | 8 | using Microsoft.UI.Xaml;
|
4 | 9 | using Microsoft.UI.Xaml.Controls;
|
5 |
| -using Microsoft.UI.Xaml.Navigation; |
6 | 10 | using Microsoft.UI.Xaml.Media.Animation;
|
| 11 | +using Microsoft.UI.Xaml.Navigation; |
| 12 | +using System; |
| 13 | +using System.Collections.Generic; |
| 14 | +using System.Linq; |
7 | 15 | using System.Runtime.InteropServices;
|
8 |
| -using AtlasToolbox.Utils; |
9 |
| -using CommunityToolkit.WinUI; |
10 |
| -using System.Windows.Input; |
11 |
| -using CommunityToolkit.Mvvm.Input; |
12 |
| -using AtlasToolbox.Views; |
13 | 16 | using System.Threading.Tasks;
|
14 |
| -using System.Collections.Generic; |
15 |
| -using Microsoft.Extensions.DependencyInjection; |
16 |
| -using AtlasToolbox.ViewModels; |
17 |
| -using Microsoft.UI.Windowing; |
| 17 | +using System.Windows.Input; |
18 | 18 | using WinUIEx;
|
19 | 19 |
|
20 | 20 | namespace AtlasToolbox
|
21 | 21 | {
|
22 | 22 | public sealed partial class MainWindow : Window
|
23 | 23 | {
|
24 | 24 | public List<IConfigurationItem> RootList { get; set; }
|
| 25 | + |
25 | 26 | public MainWindow()
|
26 | 27 | {
|
27 | 28 | this.InitializeComponent();
|
28 | 29 |
|
29 |
| - |
30 | 30 | OverlappedPresenter presenter = OverlappedPresenter.Create();
|
31 | 31 | presenter.PreferredMinimumWidth = 516;
|
32 | 32 | presenter.PreferredMinimumHeight = 491;
|
@@ -81,6 +81,22 @@ public MainWindow()
|
81 | 81 | else this.Closed += AppBehaviorHelper.CloseApp;
|
82 | 82 | }
|
83 | 83 |
|
| 84 | + public bool IsFullscreen() |
| 85 | + { |
| 86 | + var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this); |
| 87 | + var windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd); |
| 88 | + AppWindow appWindow = AppWindow.GetFromWindowId(windowId); |
| 89 | + |
| 90 | + if (appWindow.Presenter is OverlappedPresenter presenter) |
| 91 | + { |
| 92 | + if (presenter.State == OverlappedPresenterState.Maximized) |
| 93 | + { |
| 94 | + return true; |
| 95 | + } |
| 96 | + } |
| 97 | + return false; |
| 98 | + } |
| 99 | + |
84 | 100 | private async void CheckUpdates()
|
85 | 101 | {
|
86 | 102 | bool update = await Task.Run(() => ToolboxUpdateHelper.CheckUpdates());
|
|
0 commit comments