Move back button enable handling to shared method

This commit is contained in:
Dean Herbert 2022-04-20 14:50:41 +09:00
parent 9797e2d887
commit 66373bf038
1 changed files with 2 additions and 4 deletions

View File

@ -346,8 +346,6 @@ private void showPreviousStep()
stack.CurrentScreen.Exit();
currentStepIndex--;
BackButton.Enabled.Value = currentStepIndex != 0;
updateButtonText();
}
@ -358,8 +356,6 @@ private void showNextStep()
currentStepIndex++;
BackButton.Enabled.Value = currentStepIndex > 0;
if (currentStepIndex < steps.Length)
{
stack.Push((Screen)Activator.CreateInstance(steps[currentStepIndex.Value].ScreenType));
@ -377,6 +373,8 @@ private void updateButtonText()
{
Debug.Assert(currentStepIndex != null);
BackButton.Enabled.Value = currentStepIndex != 0;
NextButton.Text = currentStepIndex + 1 < steps.Length
? FirstRunSetupOverlayStrings.Next(steps[currentStepIndex.Value + 1].Description)
: CommonStrings.Finish;