Extract ClosePopup behavior for reuse, invoke on Warnings dismiss
This commit is contained in:
parent
9bdd60d483
commit
aae2976c95
1 changed files with 10 additions and 6 deletions
|
|
@ -101,12 +101,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
// Invoke FixAction
|
||||
action.Action.Invoke();
|
||||
|
||||
// Close popup on FixAction button click
|
||||
if (this.Parents<PopupWidget>().FirstOrDefault() is PopupWidget popupWidget)
|
||||
{
|
||||
UiThread.RunOnIdle(popupWidget.CloseMenu);
|
||||
}
|
||||
this.ClosePopup();
|
||||
};
|
||||
|
||||
row.AddChild(button);
|
||||
|
|
@ -131,6 +126,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
dismissButton.Click += (sender, e) =>
|
||||
{
|
||||
UserSettings.Instance.set($"Ignore_{validationError.ID}", "true");
|
||||
this.ClosePopup();
|
||||
};
|
||||
|
||||
row.AddChild(dismissButton);
|
||||
|
|
@ -139,5 +135,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
this.AddChild(row);
|
||||
}
|
||||
}
|
||||
|
||||
private void ClosePopup()
|
||||
{
|
||||
if (this.Parents<PopupWidget>().FirstOrDefault() is PopupWidget popupWidget)
|
||||
{
|
||||
UiThread.RunOnIdle(popupWidget.CloseMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue