diff --git a/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs b/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs
index 59ffb6fd1ac..2f547539fbe 100644
--- a/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs
+++ b/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs
@@ -475,9 +475,15 @@ 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 (Application.Current != null)
{
Application.Current.Shutdown();
@@ -519,6 +525,9 @@ enum ImportStatus
success
}
+ ///
+ /// This class is used to expose the methods that can be called from the webview2 component, SplashScreen.
+ ///
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class ScriptObject
@@ -528,7 +537,12 @@ public class ScriptObject
readonly Func RequestSignIn;
readonly Func RequestSignOut;
readonly Action RequestCloseWindow;
+ readonly Action RequestCloseWindowPreserve;
+ ///
+ /// [Obsolete] Constructor for ScriptObject
+ ///
+ [Obsolete]
public ScriptObject(Action requestLaunchDynamo, Action requestImportSettings, Func< bool> requestSignIn, Func requestSignOut, Action requestCloseWindow)
{
RequestLaunchDynamo = requestLaunchDynamo;
@@ -537,6 +551,17 @@ public ScriptObject(Action requestLaunchDynamo, Action requestImpo
RequestSignOut = requestSignOut;
RequestCloseWindow = requestCloseWindow;
}
+ ///
+ /// Constructor for ScriptObject with an overload for close window method, to preserve "Don't show again" setting on splash screen on explicit close event.
+ ///
+ public ScriptObject(Action requestLaunchDynamo, Action requestImportSettings, Func requestSignIn, Func requestSignOut, Action requestCloseWindow)
+ {
+ RequestLaunchDynamo = requestLaunchDynamo;
+ RequestImportSettings = requestImportSettings;
+ RequestSignIn = requestSignIn;
+ RequestSignOut = requestSignOut;
+ RequestCloseWindowPreserve = requestCloseWindow;
+ }
public void LaunchDynamo(bool showScreenAgain)
{
@@ -560,5 +585,9 @@ public void CloseWindow()
{
RequestCloseWindow();
}
+ public void CloseWindowPreserve(bool isCheckboxChecked)
+ {
+ RequestCloseWindowPreserve(isCheckboxChecked);
+ }
}
}