From 0b7e9d544d5d003989deeb23489bf88c0b3d15ca Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 24 Apr 2020 16:11:49 +0200 Subject: [PATCH] XAML Only solution --- SplashTest/App.xaml.cs | 6 +++--- SplashTest/SplashScreenMetro.xaml | 17 +++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/SplashTest/App.xaml.cs b/SplashTest/App.xaml.cs index 08192c8..36b0765 100644 --- a/SplashTest/App.xaml.cs +++ b/SplashTest/App.xaml.cs @@ -25,9 +25,9 @@ protected async override void OnStartup(StartupEventArgs e) splash.Show(); - var controller = await splash.ShowProgressAsync("Tets","Test", false, new MetroDialogSettings() { MaximumBodyHeight = 70, DialogMessageFontSize = 18 }) as ProgressDialogController; + // var controller = await splash.ShowProgressAsync("Tets","Test", false, new MetroDialogSettings() { MaximumBodyHeight = 70, DialogMessageFontSize = 18 }) as ProgressDialogController; - controller.SetIndeterminate(); + // controller.SetIndeterminate(); MainWindow main = new MainWindow(); @@ -37,7 +37,7 @@ protected async override void OnStartup(StartupEventArgs e) await Task.Delay(2500); - await controller.CloseAsync(); + // await controller.CloseAsync(); splash.Close(); diff --git a/SplashTest/SplashScreenMetro.xaml b/SplashTest/SplashScreenMetro.xaml index 614cd5d..e657bfd 100644 --- a/SplashTest/SplashScreenMetro.xaml +++ b/SplashTest/SplashScreenMetro.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:SplashTest" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - Name="Splash" + DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}" Title="SplashScreenMetro" Width="800" Height="250" @@ -15,7 +15,11 @@ UseNoneWindowStyle="True" WindowStyle="None" mc:Ignorable="d"> - + + + + +