-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split Port Views and ViewModels #12062
Conversation
@QilongTang I will fix the merge conflict but I think the IsProxy should be a property on the model and not a wrapper class. |
# Conflicts: # src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs # src/DynamoCoreWpf/ViewModels/Core/PortViewModel.cs
public bool SetConnectorsVisibility | ||
{ | ||
get => areConnectorsHidden; | ||
set | ||
{ | ||
areConnectorsHidden = value; | ||
RaisePropertyChanged(nameof(SetConnectorsVisibility)); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Enables or disables the Hide Wires button on the node output port context menu. | ||
/// </summary> | ||
public bool HideWiresButtonEnabled | ||
{ | ||
get => hideWiresButtonEnabled; | ||
set | ||
{ | ||
hideWiresButtonEnabled = value; | ||
RaisePropertyChanged(nameof(HideWiresButtonEnabled)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And these.
@@ -549,7 +549,7 @@ public AnnotationViewModel(WorkspaceViewModel workspaceViewModel, AnnotationMode | |||
internal void SetGroupInputPorts() | |||
{ | |||
InPorts.Clear(); | |||
List<ProxyPortViewModel> newPortViewModels; | |||
List<PortViewModel> newPortViewModels; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you sum this up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you asking here @mjkkirschner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry @saintentropy - why did you make all these changes related to proxy type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of additional type, @saintentropy is using a property on PortViewModel
to indicate if it is a proxy.. Given there is no new property in ProxyPortViewModel
yet, this should be OK. But in the future if we need to store additional info, this may not scale. But I am fine with it for now, How about you @mjkkirschner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjkkirschner @QilongTang I maid the change as the purpose of the new wrapper class ProxyPortViewModel was just to provide a type check and did not have a different feature set. Because there are now essentially two base classes for ports it seemed to make more sense to add the proxy status as a property (for the is proxy check) and keep the classes a bit simpler in the code.
if (_port.Connectors.Count < 1 || _node.WorkspaceViewModel.Connectors.Count < 1) return false; | ||
|
||
// Attempting to get a relevant ConnectorViewModel via matching NodeModel GUID | ||
ConnectorViewModel connectorViewModel = _node.WorkspaceViewModel.Connectors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too bad theres no map of connectors.
return connectorViewModel.IsCollapsed; | ||
} | ||
|
||
public DelegateCommand MouseLeftButtonDownOnContextCommand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same questions as in inport
private bool areConnectorsHidden; | ||
private string showHideWiresButtonContent = ""; | ||
private bool hideWiresButtonEnabled; | ||
protected static SolidColorBrush portBorderBrushColor = new SolidColorBrush(Color.FromArgb(255, 204, 204, 204)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appears some of these are repeated in the other new classes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other colors but they are specific for inputs not dup
# Conflicts: # src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the regressions should be fixed on master already
seems there is still a conflict |
@saintentropy There is one regression on this PR, once it's fixed, should be good to go
|
Oops, there is also merge conflicts to address again |
Purpose
The purpose of this PR is to split up the Port View and ViewModels. As the difference between In Ports and Out Ports has grown in UX and Code complexity, it is putting a high burden on implementation and a net drag on memory and performance of the Workspace View. This PR allows the port views to be implemented and styled independently. This PR should maintain feature capability with existing 2.13 WIP. This does introduce a 10% gain in start up time and similar for memory allocation.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@mjkkirschner @OliverEGreen @QilongTang
FYIs
@SHKnudsen