private void backButton_Click(object sender, EventArgs e) { WizardPageEventArgs wpea = PreChangePage(-1); _activePage.OnWizardBack(wpea); PostChangePage(wpea); }
private void PostChangePage(WizardPageEventArgs e) { if (!e.Cancel) { SetActivePage(e.NewPage); } }
public virtual void OnWizardBack(WizardPageEventArgs e) { if (WizardBack != null) { WizardBack(this, e); } }
public virtual void OnWizardNext(WizardPageEventArgs e) { if (WizardNext != null) { WizardNext(this, e); } }
private void nextButton_Click(object sender, EventArgs e) { _activePage.Prepare(); WizardPageEventArgs wpea = PreChangePage(+1); _activePage.OnWizardNext(wpea); PostChangePage(wpea); }
/// <summary> /// 换页预处理 /// </summary> /// <param name="delta"></param> /// <returns></returns> private WizardPageEventArgs PreChangePage(int delta) { // Figure out which page is next. int activeIndex = GetActiveIndex(); int nextIndex = activeIndex + delta; if (nextIndex < 0 || nextIndex >= Context.Pages.Count) { nextIndex = activeIndex; } // Fill in the event args. WizardPage newPage = Context.Pages[nextIndex]; WizardPageEventArgs e = new WizardPageEventArgs { NewPage = newPage.Name, Cancel = false }; return(e); }