From 0383f69248ace3465cf965f4f9feddc516053eda Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Thu, 18 Jan 2024 18:48:38 -0500 Subject: [PATCH] Update SplashScreen.xaml.cs --- .../Views/SplashScreen/SplashScreen.xaml.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs b/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs index 44918de435b..e2f35abbb8c 100644 --- a/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs +++ b/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs @@ -513,9 +513,14 @@ private static bool IsValidPreferencesFile(string filePath) /// /// If the user wants to close the window, we shutdown the application and don't launch Dynamo /// - internal void CloseWindow() + /// If true, the user has chosen to not show splash screen on next run. + internal void CloseWindow(bool isCheckboxChecked = false) { CloseWasExplicit = true; + if (viewModel != null && isCheckboxChecked) + { + viewModel.PreferenceSettings.EnableStaticSplashScreen = !isCheckboxChecked; + } if (string.IsNullOrEmpty(DynamoModel.HostAnalyticsInfo.HostName)) { @@ -571,9 +576,9 @@ public class ScriptObject readonly Action RequestImportSettings; readonly Func RequestSignIn; readonly Func RequestSignOut; - readonly Action RequestCloseWindow; + readonly Action RequestCloseWindow; - public ScriptObject(Action requestLaunchDynamo, Action requestImportSettings, Func< bool> requestSignIn, Func requestSignOut, Action requestCloseWindow) + public ScriptObject(Action requestLaunchDynamo, Action requestImportSettings, Func< bool> requestSignIn, Func requestSignOut, Action requestCloseWindow) { RequestLaunchDynamo = requestLaunchDynamo; RequestImportSettings = requestImportSettings; @@ -600,9 +605,9 @@ public bool SignOut() { return RequestSignOut(); } - public void CloseWindow() + public void CloseWindow(bool isCheckboxChecked) { - RequestCloseWindow(); + RequestCloseWindow(isCheckboxChecked); } } }