Extract navigate home behavior to reusable method

This commit is contained in:
jlewin 2019-05-09 11:54:56 -07:00
parent 4d45ece99a
commit e32b276f09

View file

@ -186,10 +186,7 @@ namespace MatterHackers.MatterControl
if (this.ActiveStage == null
|| this.ActiveStage?.ClosePage() == true)
{
// Construct and move to the summary/home page
this.ChangeToPage(setupWizard.HomePageGenerator());
this.ActiveStage = null;
NavigateHome();
}
else
{
@ -197,5 +194,16 @@ namespace MatterHackers.MatterControl
this.ChangeToPage(this.ActiveStage.Current);
}
}
/// <summary>
/// Unconditionally change back to the home page and exit any active stage
/// </summary>
private void NavigateHome()
{
// Construct and move to the summary/home page
this.ChangeToPage(setupWizard.HomePageGenerator());
this.ActiveStage = null;
}
}
}