From 6fd428317163b20eaf745750d3ab4c90d6bf3d1b Mon Sep 17 00:00:00 2001 From: erri120 Date: Mon, 7 Oct 2019 15:48:40 +0200 Subject: [PATCH] Changing properties only works if the compiler ui is ready --- Wabbajack/AppState.cs | 12 ++++++---- Wabbajack/ModlistPropertiesWindow.xaml.cs | 29 +++++++++++++---------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Wabbajack/AppState.cs b/Wabbajack/AppState.cs index c77ce891..25a87fcd 100644 --- a/Wabbajack/AppState.cs +++ b/Wabbajack/AppState.cs @@ -177,12 +177,14 @@ namespace Wabbajack internal ModlistPropertiesWindow modlistPropertiesWindow; private void OpenModListProperties() { - if(modlistPropertiesWindow == null) - { - modlistPropertiesWindow = new ModlistPropertiesWindow(this); - + if (UIReady) { + if (modlistPropertiesWindow == null) + { + modlistPropertiesWindow = new ModlistPropertiesWindow(this); + + } + modlistPropertiesWindow.Show(); } - modlistPropertiesWindow.Show(); } public string _nexusSiteURL = null; diff --git a/Wabbajack/ModlistPropertiesWindow.xaml.cs b/Wabbajack/ModlistPropertiesWindow.xaml.cs index c45b64da..592809c1 100644 --- a/Wabbajack/ModlistPropertiesWindow.xaml.cs +++ b/Wabbajack/ModlistPropertiesWindow.xaml.cs @@ -49,21 +49,24 @@ namespace Wabbajack private void SaveProperties_Click(object sender, RoutedEventArgs e) { - BitmapImage splashScreen = null; - if (newBannerFile != null) + if (state.UIReady) { - splashScreen = new BitmapImage(new Uri(newBannerFile)); + BitmapImage splashScreen = null; + if (newBannerFile != null) + { + splashScreen = new BitmapImage(new Uri(newBannerFile)); + } + string modListName = ModlistNameProperty.Text; + string modListAuthor = ModlistAuthorProperty.Text; + string modListDescription = ModlistDescriptionProperty.Text; + + state.SplashScreenImage = splashScreen; + state.SplashScreenModName = modListName; + state.SplashScreenSummary = modListDescription; + state.SplashScreenAuthorName = modListAuthor; + + Hide(); } - string modListName = ModlistNameProperty.Text; - string modListAuthor = ModlistAuthorProperty.Text; - string modListDescription = ModlistDescriptionProperty.Text; - - state.SplashScreenImage = splashScreen; - state.SplashScreenModName = modListName; - state.SplashScreenSummary = modListDescription; - state.SplashScreenAuthorName = modListAuthor; - - Hide(); } } }