public void InsertPage(int index, IWizardPageInfo page) { if (page != null && GetPageIndex(page.PageName) == -1) { Pages.Insert(index, page); } }
public void RemovePage(IWizardPageInfo pageInfo) { int pageIndex = IndexOf(pageInfo); if (pageIndex != -1) { Pages[pageIndex].PageStatusChanged -= OnPageStatusChanged; Pages[pageIndex].PagePropertyChanged -= OnPagePropertyChanged; Pages.RemoveAt(pageIndex); // If the page about to be removed is the current page, navigate to previous one if (_currentIndex == pageIndex) { GoToPage(_currentIndex - 1); } } }
public void AddPage(IWizardPageInfo page, IWizardPageNotificationObject notificationObject = null) { if (page != null) { if (GetPageIndex(page.PageName) == -1) { Pages.Add(page); page.PageStatusChanged += OnPageStatusChanged; page.PagePropertyChanged += OnPagePropertyChanged; if (notificationObject != null) { page.NotificationObject = notificationObject; } // If this is first page we insert, navigate to it if (_currentIndex == -1) { GoToPage(0); } } } }
private void NotifyPageStatusChanged(IWizardPageInfo page, WizardPageStatus newStatus) { page.NotificationObject?.OnPageStatusChanged(newStatus); }
public int IndexOf(IWizardPageInfo pageInfo) { return(Pages.IndexOf(pageInfo)); }