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 8585 <PackageReference Include =" CommunityToolkit.WinUI.UI.Controls" Version =" 7.1.2" />
8686 <PackageReference Include =" TagLibSharp" Version =" 2.3.0" />
8787 <PackageReference Include =" Tulpep.ActiveDirectoryObjectPicker" Version =" 3.0.11" />
88+ <PackageReference Include =" WinUIEx" Version =" 2.3.4" />
8889 <PackageReference Include =" Vanara.Windows.Extensions" Version =" 4.0.1" />
8990 <PackageReference Include =" Vanara.Windows.Shell" Version =" 4.0.1" />
9091 <PackageReference Include =" Microsoft.Management.Infrastructure" Version =" 3.0.0" />
Original file line number Diff line number Diff line change 11<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
2- <items : WindowEx
2+ <winuiex : WindowEx
33 x:Class=" Files.App.MainWindow"
44 xmlns=" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
55 xmlns:x=" http://schemas.microsoft.com/winfx/2006/xaml"
66 xmlns:d=" http://schemas.microsoft.com/expression/blend/2008"
77 xmlns:items=" using:Files.App.Data.Items"
88 xmlns:mc=" http://schemas.openxmlformats.org/markup-compatibility/2006"
9+ xmlns:winuiex=" using:WinUIEx"
910 mc:Ignorable=" d" />
Original file line number Diff line number Diff line change 1313
1414namespace Files . App
1515{
16- public sealed partial class MainWindow : WindowEx
16+ public sealed partial class MainWindow : WinUIEx . WindowEx
1717 {
1818 private static MainWindow ? _Instance ;
1919 public static MainWindow Instance => _Instance ??= new ( ) ;
2020
21- public MainWindow ( ) : base ( minWidth : 516 , minHeight : 416 )
21+ public nint WindowHandle { get ; }
22+
23+ public MainWindow ( )
2224 {
2325 InitializeComponent ( ) ;
2426
27+ WindowHandle = WinUIEx . WindowExtensions . GetWindowHandle ( this ) ;
28+ MinHeight = 416 ;
29+ MinWidth = 516 ;
2530 ExtendsContentIntoTitleBar = true ;
2631 Title = "Files" ;
2732 AppWindow . TitleBar . ButtonBackgroundColor = Colors . Transparent ;
@@ -188,9 +193,8 @@ public async Task InitializeApplicationAsync(object activatedEventArgs)
188193 Win32Helper . BringToForegroundEx ( new ( WindowHandle ) ) ;
189194 }
190195
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
194198 }
195199
196200 private Frame ? EnsureWindowIsInitialized ( )
You can’t perform that action at this time.
0 commit comments