Adjusted splash screen to enable loading of data prior to launching main application.

This commit is contained in:
2025-05-22 10:48:28 -04:00
parent 3807349f1f
commit 0d997585ac
2 changed files with 17 additions and 4 deletions

View File

@@ -5,10 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:osrs_toolbox" xmlns:local="clr-namespace:osrs_toolbox"
mc:Ignorable="d" mc:Ignorable="d"
Title="OSRS Toolbox" SizeToContent="WidthAndHeight" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ResizeMode="NoResize" MouseDown="Window_MouseDown" WindowStartupLocation="CenterScreen"> Title="OSRS Toolbox" SizeToContent="WidthAndHeight" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ResizeMode="NoResize" MouseDown="Window_MouseDown" WindowStartupLocation="CenterScreen" PreviewKeyDown="Window_PreviewKeyDown" Loaded="Window_Loaded">
<Window.DataContext>
<local:SplashScreenViewModel/>
</Window.DataContext>
<Grid> <Grid>
<Image Source="/Resources/SplashScreenLogo.png" MaxHeight="540"/> <Image Source="/Resources/SplashScreenLogo.png" MaxHeight="540"/>
</Grid> </Grid>

View File

@@ -32,5 +32,21 @@ namespace osrs_toolbox
if (e.LeftButton == MouseButtonState.Pressed) if (e.LeftButton == MouseButtonState.Pressed)
DragMove(); DragMove();
} }
private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Space)
{
Application.Current.MainWindow = HomePageView.Current;
HomePageView.Current.Show();
this.Close();
}
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
HomePageView hp = new HomePageView();
//TODO: Handle loading of data into datacontext, then open home screen
}
} }
} }