MainWindow.xaml.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using System;
 6  using ManagedCommon;
 7  using Microsoft.UI.Windowing;
 8  using Microsoft.UI.Xaml;
 9  using Microsoft.UI.Xaml.Media;
10  using PowerToys.FileLocksmithUI.Helpers;
11  using WinUIEx;
12  
13  namespace FileLocksmithUI
14  {
15      public sealed partial class MainWindow : WindowEx, IDisposable
16      {
17          public MainWindow(bool isElevated)
18          {
19              InitializeComponent();
20              mainPage.ViewModel.IsElevated = isElevated;
21              SetTitleBar(titleBar);
22              ExtendsContentIntoTitleBar = true;
23              AppWindow.TitleBar.PreferredHeightOption = TitleBarHeightOption.Tall;
24              AppWindow.SetIcon("Assets/FileLocksmith/Icon.ico");
25              WindowHelpers.ForceTopBorder1PixelInsetOnWindows10(this.GetWindowHandle());
26  
27              var loader = ResourceLoaderInstance.ResourceLoader;
28              var title = isElevated ? loader.GetString("AppAdminTitle") : loader.GetString("AppTitle");
29              Title = title;
30              titleBar.Title = title;
31          }
32  
33          public void Dispose()
34          {
35          }
36      }
37  }