private void NextBtn_Click(object sender, RoutedEventArgs e) { if (index == 0) { info = essentials.save(); this.EdirName = info[0]; this.Description = info[1]; MainContent.Children.Clear(); MainContent.Children.Add(nextPage); index = 1; } else if (index == 1) { try { payments = nextPage.Save(); this.PayMem = payments[0]; this.PaySib = payments[1]; this.PayChild = payments[2]; this.PayParent = payments[3]; this.EventFin = payments[4]; } catch (Exception) { this.PayMem = this.PaySib = this.PayChild = this.PayParent = this.EventFin = 0; } MainContent.Children.Clear(); MainContent.Children.Add(thirdPage); thirdPage.Initialize(EdirName, Description, PayMem, PaySib, PayChild, PayParent, EventFin); index = 2; NextBtn.Visibility = Visibility.Hidden; } }