File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 85
85
<PackageReference Include =" CommunityToolkit.WinUI.UI.Controls" Version =" 7.1.2" />
86
86
<PackageReference Include =" TagLibSharp" Version =" 2.3.0" />
87
87
<PackageReference Include =" Tulpep.ActiveDirectoryObjectPicker" Version =" 3.0.11" />
88
+ <PackageReference Include =" WinUIEx" Version =" 2.3.4" />
88
89
<PackageReference Include =" Vanara.Windows.Extensions" Version =" 4.0.1" />
89
90
<PackageReference Include =" Vanara.Windows.Shell" Version =" 4.0.1" />
90
91
<PackageReference Include =" Microsoft.Management.Infrastructure" Version =" 3.0.0" />
Original file line number Diff line number Diff line change 1
1
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
2
- <items : WindowEx
2
+ <winuiex : WindowEx
3
3
x:Class=" Files.App.MainWindow"
4
4
xmlns=" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5
5
xmlns:x=" http://schemas.microsoft.com/winfx/2006/xaml"
6
6
xmlns:d=" http://schemas.microsoft.com/expression/blend/2008"
7
7
xmlns:items=" using:Files.App.Data.Items"
8
8
xmlns:mc=" http://schemas.openxmlformats.org/markup-compatibility/2006"
9
+ xmlns:winuiex=" using:WinUIEx"
9
10
mc:Ignorable=" d" />
Original file line number Diff line number Diff line change 13
13
14
14
namespace Files . App
15
15
{
16
- public sealed partial class MainWindow : WindowEx
16
+ public sealed partial class MainWindow : WinUIEx . WindowEx
17
17
{
18
18
private static MainWindow ? _Instance ;
19
19
public static MainWindow Instance => _Instance ??= new ( ) ;
20
20
21
- public MainWindow ( ) : base ( minWidth : 516 , minHeight : 416 )
21
+ public nint WindowHandle { get ; }
22
+
23
+ public MainWindow ( )
22
24
{
23
25
InitializeComponent ( ) ;
24
26
27
+ WindowHandle = WinUIEx . WindowExtensions . GetWindowHandle ( this ) ;
28
+ MinHeight = 416 ;
29
+ MinWidth = 516 ;
25
30
ExtendsContentIntoTitleBar = true ;
26
31
Title = "Files" ;
27
32
AppWindow . TitleBar . ButtonBackgroundColor = Colors . Transparent ;
@@ -188,9 +193,8 @@ public async Task InitializeApplicationAsync(object activatedEventArgs)
188
193
Win32Helper . BringToForegroundEx ( new ( WindowHandle ) ) ;
189
194
}
190
195
191
- if ( Windows . Win32 . PInvoke . IsIconic ( new ( WindowHandle ) ) &&
192
- AppWindow . Presenter is OverlappedPresenter presenter )
193
- presenter . Restore ( ) ; // Restore window if minimized
196
+ if ( Windows . Win32 . PInvoke . IsIconic ( new ( WindowHandle ) ) )
197
+ WinUIEx . WindowExtensions . Restore ( Instance ) ; // Restore window if minimized
194
198
}
195
199
196
200
private Frame ? EnsureWindowIsInitialized ( )
You can’t perform that action at this time.
0 commit comments