protected virtual void OnBeforePageChanged(WizardCancelEventArgs e) { //Invokes the delegates. if (BeforePageChangedEvent != null) { BeforePageChangedEvent(this, e); } }
/// <Summary> /// PreviousPage runs when the Back Button is clicked and raises a PreviousPage /// Event /// </Summary> private void PreviousPage(object sender, CommandEventArgs e) { if (CurrentPage > 0) { int PrevPage = CurrentPage; WizardCancelEventArgs wce = new WizardCancelEventArgs(CurrentPage, PrevPage, Pages); OnBeforePageChanged(wce); if (wce.Cancel == false) { //Event Not Cancelled by Event Consumer CurrentPage--; WizardEventArgs we = new WizardEventArgs(CurrentPage, PrevPage, Pages); OnAfterPageChanged(we); } } DisplayCurrentPage(); }
/// <Summary> /// NextPage runs when the Next Button is clicked and raises a NextPage Event /// </Summary> private void NextPage(object sender, CommandEventArgs e) { //If we are not on the last page Create a New WizardEventArgs Object //and trigger a Previous Page Event if (CurrentPage < Pages.Count - 1) { int PrevPage = CurrentPage; WizardCancelEventArgs wce = new WizardCancelEventArgs(CurrentPage, PrevPage, Pages); OnBeforePageChanged(wce); if (wce.Cancel == false) { //Event Not Cancelled by Event Consumer CurrentPage++; WizardEventArgs we = new WizardEventArgs(CurrentPage, PrevPage, Pages); OnAfterPageChanged(we); } } DisplayCurrentPage(); }
/// <Summary> /// PreviousPage runs when the Back Button is clicked and raises a PreviousPage /// Event /// </Summary> private void PreviousPage( object sender, CommandEventArgs e ) { if (CurrentPage > 0) { int PrevPage = CurrentPage; WizardCancelEventArgs wce = new WizardCancelEventArgs(CurrentPage, PrevPage, Pages); OnBeforePageChanged(wce); if (wce.Cancel == false) { //Event Not Cancelled by Event Consumer CurrentPage--; WizardEventArgs we = new WizardEventArgs(CurrentPage, PrevPage, Pages); OnAfterPageChanged(we); } } DisplayCurrentPage(); }
/// <Summary> /// NextPage runs when the Next Button is clicked and raises a NextPage Event /// </Summary> private void NextPage( object sender, CommandEventArgs e ) { //If we are not on the last page Create a New WizardEventArgs Object //and trigger a Previous Page Event if (CurrentPage < Pages.Count - 1) { int PrevPage = CurrentPage; WizardCancelEventArgs wce = new WizardCancelEventArgs(CurrentPage, PrevPage, Pages); OnBeforePageChanged(wce); if (wce.Cancel == false) { //Event Not Cancelled by Event Consumer CurrentPage++; WizardEventArgs we = new WizardEventArgs(CurrentPage, PrevPage, Pages); OnAfterPageChanged(we); } } DisplayCurrentPage(); }