添加启动页

This commit is contained in:
2025-07-26 11:20:03 +08:00
parent e292ea9da8
commit db419edde3
10 changed files with 249 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
<Window x:Class="DMS.WPF.Views.SplashWindow"
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:local="clr-namespace:DMS.WPF.Views"
mc:Ignorable="d"
Title="SplashWindow" Height="400" Width="600"
WindowStyle="None" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="Transparent">
<Grid>
<Border CornerRadius="10" Background="#FF333333">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Assets/AppIcon.png" Width="100" Height="100"/>
<TextBlock Text="{Binding LoadingMessage}" Foreground="White" FontSize="16" Margin="0,20,0,0"/>
</StackPanel>
</Border>
</Grid>
</Window>

View File

@@ -0,0 +1,22 @@
// 文件: DMS.WPF/Views/SplashWindow.xaml.cs
using DMS.WPF.ViewModels;
using System.Windows;
namespace DMS.WPF.Views;
/// <summary>
/// SplashWindow.xaml 的交互逻辑
/// </summary>
public partial class SplashWindow : Window
{
public SplashWindow(SplashViewModel viewModel)
{
InitializeComponent();
DataContext = viewModel;
Loaded += async (s, e) =>
{
await viewModel.InitializeAsync();
Close();
};
}
}