From 9a43166d4951760098222572290553d2bc07a1a5 Mon Sep 17 00:00:00 2001 From: achiez Date: Thu, 8 May 2025 00:21:34 +0300 Subject: [PATCH] Add SplashScreen base --- update.xml => NebulaAuth/update.xml | 0 src/NebulaAuth/App.xaml | 1 + src/NebulaAuth/NebulaAuth.csproj | 2 +- .../WindowStyle/LoadingSplashScreenStyle.xaml | 107 ++++++++++++++++++ .../LoadingSplashScreenStyle.xaml.cs | 35 ++++++ src/NebulaAuth/View/LoadingSplashScreen.xaml | 24 ++++ .../View/LoadingSplashScreen.xaml.cs | 29 +++++ 7 files changed, 197 insertions(+), 1 deletion(-) rename update.xml => NebulaAuth/update.xml (100%) create mode 100644 src/NebulaAuth/Theme/WindowStyle/LoadingSplashScreenStyle.xaml create mode 100644 src/NebulaAuth/Theme/WindowStyle/LoadingSplashScreenStyle.xaml.cs create mode 100644 src/NebulaAuth/View/LoadingSplashScreen.xaml create mode 100644 src/NebulaAuth/View/LoadingSplashScreen.xaml.cs diff --git a/update.xml b/NebulaAuth/update.xml similarity index 100% rename from update.xml rename to NebulaAuth/update.xml diff --git a/src/NebulaAuth/App.xaml b/src/NebulaAuth/App.xaml index f972c5c..b2f8ef1 100644 --- a/src/NebulaAuth/App.xaml +++ b/src/NebulaAuth/App.xaml @@ -98,6 +98,7 @@ + diff --git a/src/NebulaAuth/NebulaAuth.csproj b/src/NebulaAuth/NebulaAuth.csproj index 038599a..222dbfe 100644 --- a/src/NebulaAuth/NebulaAuth.csproj +++ b/src/NebulaAuth/NebulaAuth.csproj @@ -49,7 +49,7 @@ - + diff --git a/src/NebulaAuth/Theme/WindowStyle/LoadingSplashScreenStyle.xaml b/src/NebulaAuth/Theme/WindowStyle/LoadingSplashScreenStyle.xaml new file mode 100644 index 0000000..354b6e7 --- /dev/null +++ b/src/NebulaAuth/Theme/WindowStyle/LoadingSplashScreenStyle.xaml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/NebulaAuth/Theme/WindowStyle/LoadingSplashScreenStyle.xaml.cs b/src/NebulaAuth/Theme/WindowStyle/LoadingSplashScreenStyle.xaml.cs new file mode 100644 index 0000000..14f6f92 --- /dev/null +++ b/src/NebulaAuth/Theme/WindowStyle/LoadingSplashScreenStyle.xaml.cs @@ -0,0 +1,35 @@ +using System.Windows; + +namespace NebulaAuth.Theme.WindowStyle; + +/// +/// Логика взаимодействия для WindowStyle.xaml +/// +partial class LoadingSplashScreenStyle +{ + public LoadingSplashScreenStyle() + { + InitializeComponent(); + } + + private void OnCloseClick(object sender, RoutedEventArgs e) + { + var window = (Window) ((FrameworkElement) sender).TemplatedParent; + + window.Close(); + } + + private void OnMaximizeRestoreClick(object sender, RoutedEventArgs e) + { + var window = (Window) ((FrameworkElement) sender).TemplatedParent; + + window.WindowState = window.WindowState == WindowState.Normal ? WindowState.Maximized : WindowState.Normal; + } + + private void OnMinimizeClick(object sender, RoutedEventArgs e) + { + var window = (Window) ((FrameworkElement) sender).TemplatedParent; + + window.WindowState = WindowState.Minimized; + } +} \ No newline at end of file diff --git a/src/NebulaAuth/View/LoadingSplashScreen.xaml b/src/NebulaAuth/View/LoadingSplashScreen.xaml new file mode 100644 index 0000000..c88e86f --- /dev/null +++ b/src/NebulaAuth/View/LoadingSplashScreen.xaml @@ -0,0 +1,24 @@ + + + + + + diff --git a/src/NebulaAuth/View/LoadingSplashScreen.xaml.cs b/src/NebulaAuth/View/LoadingSplashScreen.xaml.cs new file mode 100644 index 0000000..8600bf4 --- /dev/null +++ b/src/NebulaAuth/View/LoadingSplashScreen.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using NebulaAuth.Theme; + +namespace NebulaAuth.View +{ + /// + /// Логика взаимодействия для LoadingSplashScreen.xaml + /// + public partial class LoadingSplashScreen : FontScaleWindow + { + public LoadingSplashScreen() + { + InitializeComponent(); + } + } +}