Skip to content
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

Handling the Custom Nodes and Trusted Location message #13138

Merged
merged 10 commits into from
Aug 5, 2022
11 changes: 10 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Core/HomeWorkspaceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,18 @@ public HomeWorkspaceViewModel(HomeWorkspaceModel model, DynamoViewModel dynamoVi
hwm.SetNodeDeltaState +=hwm_SetNodeDeltaState;

dynamoViewModel.Model.ShutdownStarted += Model_ShutdownStarted;

dynamoViewModel.PropertyChanged += DynamoViewModel_PropertyChanged;
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
SetupFooterNotificationItems();
}

private void DynamoViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(DynamoViewModel.CurrentSpace) && !(sender as DynamoViewModel).ViewingHomespace)
jesusalvino marked this conversation as resolved.
Show resolved Hide resolved
{
ClearWarning();
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
}
}

/// <summary>
/// Setup the initial collection of FooterNotificationItems
/// </summary>
Expand Down Expand Up @@ -496,6 +504,7 @@ public override void Dispose()
RunSettingsViewModel.Dispose();
RunSettingsViewModel = null;
DynamoViewModel.Model.ShutdownStarted -= Model_ShutdownStarted;
DynamoViewModel.Model.PropertyChanged -= DynamoViewModel_PropertyChanged;
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/DynamoCoreWpf/Views/FileTrust/FileTrustWarning.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public FileTrustWarning(DynamoView dynamoViewWindow)
SetUpPopup();

HomeWorkspaceModel.WorkspaceClosed += CloseWarningPopup;
dynViewModel.PropertyChanged += DynViewModel_PropertyChanged;
}

private void DynViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "CurrentSpace" && !dynViewModel.ViewingHomespace)
{
IsOpen = false;
}
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
}

private void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
Expand Down Expand Up @@ -170,6 +179,7 @@ internal void CleanPopup()
}

HomeWorkspaceModel.WorkspaceClosed -= CloseWarningPopup;
dynViewModel.PropertyChanged -= DynViewModel_PropertyChanged;
}

/// <summary>
Expand Down