feat: add splash window.
This commit is contained in:
12
demo/Sandbox/Views/MainSplashWindow.axaml
Normal file
12
demo/Sandbox/Views/MainSplashWindow.axaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<u:SplashWindow xmlns="https://github.com/avaloniaui"
|
||||
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:u="https://irihi.tech/ursa"
|
||||
mc:Ignorable="d" d:DesignWidth="800"
|
||||
d:DesignHeight="450"
|
||||
CountDown="0:0:2"
|
||||
x:Class="Sandbox.Views.MainSplashWindow"
|
||||
Title="MainSplashWindow">
|
||||
Welcome to Avalonia Splash Window!
|
||||
</u:SplashWindow>
|
||||
27
demo/Sandbox/Views/MainSplashWindow.axaml.cs
Normal file
27
demo/Sandbox/Views/MainSplashWindow.axaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Threading;
|
||||
using Sandbox.ViewModels;
|
||||
using Ursa.Controls;
|
||||
|
||||
namespace Sandbox.Views;
|
||||
|
||||
public partial class MainSplashWindow : SplashWindow
|
||||
{
|
||||
public MainSplashWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override async Task<Window> CreateNextWindow()
|
||||
{
|
||||
return new MainWindow()
|
||||
{
|
||||
DataContext = new MainWindowViewModel()
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user