From 07a0033d5a936ab3ab232fd08023e3d6bf034efb Mon Sep 17 00:00:00 2001 From: reddyashish <43763136+reddyashish@users.noreply.github.com> Date: Fri, 12 May 2023 06:59:10 -0400 Subject: [PATCH 1/9] Python docking improvements --- .../Properties/Resources.Designer.cs | 4 +- .../Properties/Resources.en-US.resx | 2 +- src/DynamoCoreWpf/Properties/Resources.resx | 2 +- .../UI/GuidedTour/GuidesValidationMethods.cs | 4 +- .../ViewModels/Core/DynamoViewModel.cs | 19 +++++- src/DynamoCoreWpf/Views/Core/DynamoView.xaml | 8 +-- .../Views/Core/DynamoView.xaml.cs | 67 +++++++------------ .../PythonNodeModelsWpf/PythonNode.cs | 40 ++++++++++- .../ScriptEditorWindow.xaml | 4 +- .../ScriptEditorWindow.xaml.cs | 9 ++- .../PythonNodeCustomizationTests.cs | 14 ++-- .../DocumentationBrowserViewExtensionTests.cs | 42 ++++++------ .../GraphNodeManagerViewExtensionTests.cs | 24 +++---- .../ViewExtensions/ViewExtensionTests.cs | 54 +++++++-------- .../WorkspaceDependencyViewExtensionTests.cs | 24 +++---- .../PythonMigrationViewExtensionTests.cs | 6 +- 16 files changed, 183 insertions(+), 140 deletions(-) diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 2fa3cbce17d..05913c6453c 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -8407,7 +8407,7 @@ public static string ShowWiresPopupMenuItem { } /// - /// Looks up a localized string similar to SideBar Panel. + /// Looks up a localized string similar to SideBar. /// public static string SideBarPanelViewTitle { get { diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index bdc3e99e651..85b2a5bc163 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -2143,7 +2143,7 @@ Do you want to install the latest Dynamo update? Write note here - SideBar Panel + SideBar Extension tab added to the extensions side bar. diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index df931defe28..86f561f83a4 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -2367,7 +2367,7 @@ Want to publish a different package? Write note here - SideBar Panel + SideBar Extension tab added to the extensions side bar. diff --git a/src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs b/src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs index 88475f157f0..a444a69e499 100644 --- a/src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs +++ b/src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs @@ -577,14 +577,14 @@ internal static void ExecuteViewDetailsSideBar(Step stepInfo, StepUIAutomation u if (packageDetailsWindow == null) return; //In order to close the Package Details tab we need first to get the Tab, then get the Close button and finally call the event to close it - TabItem tabitem = dynamoView.SideBarPanelTabItems.OfType().SingleOrDefault(n => n.Header.ToString() == packageDetailsName); + TabItem tabitem = stepInfo.DynamoViewModelStep.SideBarTabItems.OfType().SingleOrDefault(n => n.Header.ToString() == packageDetailsName); if (tabitem == null) return; //Get the Close button from the PackageDetailsView Button closeButton = GuideUtilities.FindChild(tabitem, closeButtonName) as Button; if (closeButton == null) return; - dynamoView.OnCloseRightSidePanelTab(closeButton, null); + dynamoView.OnCloseRightSideBarTab(closeButton, null); } } diff --git a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs index 373843a3c29..35d2653ddbc 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs @@ -9,6 +9,7 @@ using System.Linq; using System.Reflection; using System.Windows; +using System.Windows.Controls; using System.Windows.Forms; using System.Windows.Media; using System.Windows.Threading; @@ -63,8 +64,8 @@ public partial class DynamoViewModel : ViewModelBase, IDynamoViewModel // Can the user run the graph private bool CanRunGraph => HomeSpace.RunSettings.RunEnabled && !HomeSpace.GraphRunInProgress; - private ObservableCollection watch3DViewModels = new ObservableCollection(); + private ObservableCollection sideBarTabItems = new ObservableCollection(); /// /// An observable collection of workspace view models which tracks the model @@ -81,6 +82,22 @@ public partial class DynamoViewModel : ViewModelBase, IDynamoViewModel /// internal Dictionary NodeWindowsState { get; set; } = new Dictionary(); + /// + /// Collection of Right SideBar tab items: view extensions and docked windows. + /// + public ObservableCollection SideBarTabItems + { + get + { + return sideBarTabItems; + } + set + { + sideBarTabItems = value; + RaisePropertyChanged(nameof(SideBarTabItems)); + } + } + public ObservableCollection Workspaces { get { return workspaces; } diff --git a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml index 3711f789b27..64514408b82 100644 --- a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml +++ b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml @@ -1556,7 +1556,7 @@ Grid.Row="2" Grid.Column="4" Grid.RowSpan="2"> - +