This commit is contained in:
Steven Hobs
2026-03-03 02:04:30 +08:00
commit d451e738b0
12 changed files with 1034 additions and 0 deletions

26
Views/MainWindow.xaml Normal file
View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<winex:WindowEx
x:Class="MyApp.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winex="using:WinUIEx"
Title="MainWindow"
mc:Ignorable="d">
<Window.SystemBackdrop>
<MicaBackdrop />
</Window.SystemBackdrop>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TitleBar x:Name="AppTitleBar" Title="{x:Bind Title}">
<TitleBar.IconSource>
<ImageIconSource ImageSource="/Assets/icons/titlebar.ico" />
</TitleBar.IconSource>
</TitleBar>
</Grid>
</winex:WindowEx>

13
Views/MainWindow.xaml.cs Normal file
View File

@@ -0,0 +1,13 @@
namespace MyApp.Views;
using WinUIEx;
public sealed partial class MainWindow : WindowEx
{
public MainWindow()
{
InitializeComponent();
this.SetIcon("Assets/icons/titlebar.ico");
ExtendsContentIntoTitleBar = true;
SetTitleBar(AppTitleBar);
}
}