From c6df6e6ad49ee2e6bab79c9798ce08232adbacd0 Mon Sep 17 00:00:00 2001 From: aparajit-pratap Date: Thu, 21 Sep 2023 10:06:15 -0400 Subject: [PATCH] Fix for element binding messagebox display on saveas (#14424) * remove coreclr-ncalc references * fix for element binding messagebox on saveas --- src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs | 2 +- test/DynamoCoreWpfTests/DynamoViewTests.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs b/src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs index 5835f3fd280..522f27678e6 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs @@ -628,7 +628,7 @@ internal bool Save(string filePath, bool isBackup = false, EngineController engi { // For intentional SaveAs either through UI or API calls, replace workspace elements' Guids and workspace Id jo["Uuid"] = Guid.NewGuid().ToString(); - if (jo["Bindings"] != JToken.Parse("[]")) + if (jo["Bindings"] != null && jo["Bindings"].Any()) { jo["Bindings"] = JToken.Parse("[]"); diff --git a/test/DynamoCoreWpfTests/DynamoViewTests.cs b/test/DynamoCoreWpfTests/DynamoViewTests.cs index f0f6e4d1c49..3ca828479a6 100644 --- a/test/DynamoCoreWpfTests/DynamoViewTests.cs +++ b/test/DynamoCoreWpfTests/DynamoViewTests.cs @@ -170,7 +170,8 @@ public void ElementBinding_SaveAs() File.Delete(filePath); File.Delete(saveAsPath); } - + + [Test] public void TestToastNotificationClosingBehavior() { var preferencesWindow = new PreferencesView(View);