Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
ivaylo-matov committed Apr 17, 2024
1 parent 4824298 commit 60c0df2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/DynamoCore/Graph/Annotations/AnnotationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ void SerializeCore(XmlElement element, SaveContext context)
helper.SetAttribute("TextblockHeight", this.TextBlockHeight);
helper.SetAttribute("backgrouund", (this.Background == null ? "" : this.Background.ToString()));
helper.SetAttribute(nameof(IsSelected), IsSelected);
helper.SetAttribute(nameof(IsExpanded), IsExpanded);
helper.SetAttribute(nameof(IsExpanded), this.IsExpanded);

//Serialize Selected models
XmlDocument xmlDoc = element.OwnerDocument;
Expand Down Expand Up @@ -766,8 +766,6 @@ protected override void DeserializeCore(XmlElement element, SaveContext context)
RaisePropertyChanged(nameof(GroupStyleId));
RaisePropertyChanged(nameof(AnnotationText));
RaisePropertyChanged(nameof(Nodes));
// ip comment:
// this is called on Undo. Is VM listening?
RaisePropertyChanged(nameof(IsExpanded));
this.ReportPosition();
}
Expand Down
14 changes: 7 additions & 7 deletions src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,12 +1050,16 @@ private void UpdateConnectorsAndPortsOnShowContents(IEnumerable<ModelBase> nodes


/// <summary>
/// Handles the expansion or collapse of the annotation group in the view model.
/// Manages the expansion or collapse of the annotation group in the view model.
/// </summary>
private void ManageAnnotationMVExpansionAndCollapse()
{
InPorts.Clear();
OutPorts.Clear();
if (InPorts.Any() || OutPorts.Any())
{
InPorts.Clear();
OutPorts.Clear();
}

if (annotationModel.IsExpanded)
{
this.ShowGroupContents();
Expand Down Expand Up @@ -1226,12 +1230,8 @@ private void model_PropertyChanged(object sender, System.ComponentModel.Property
RaisePropertyChanged(nameof(AnnotationModel.Position));
UpdateProxyPortsPosition();
break;

// ip code:
case nameof(IsExpanded):
//UpdateAnnotationAfterUndo();
ManageAnnotationMVExpansionAndCollapse();
//RaisePropertyChanged("IsExpanded");
break;

}
Expand Down

0 comments on commit 60c0df2

Please sign in to comment.