public void ChangeCurrentPage(MtPageDescription newPage, int nextPageIndex) { if (_pages.Count <= nextPageIndex) { _pages.Add(newPage); } CurrentIndex = nextPageIndex; }
/// <exception cref="ArgumentException">The current page cannot be removed from the stack. </exception> public bool RemovePageFromStack(MtPageDescription pageDescription) { var index = GetPageIndex(pageDescription); if (index >= 0) { RemovePageFromStackAt(index); return(true); } return(false); }
public async Task <bool> MoveToTop(MtPageDescription page, Func <MtPageDescription, Task <bool> > action) { if (CurrentPage == page) { return(true); } var index = _pages.IndexOf(page); if (index != -1) { _pages.RemoveAt(index); _currentIndex--; if (await action(page)) { return(true); } _pages.Insert(index, page); } return(false); }
public int GetPageIndex(MtPageDescription pageDescription) { return(_pages.IndexOf(pageDescription)); }