Exemplo n.º 1
0
 public RootPage()
 {
     lastMenuType    = MenuType.Logout;
     Pages           = new Dictionary <MenuType, NavigationPage>();
     Title           = TextResources.XChallenge;
     Master          = new MenuPage(this);
     BackgroundColor = Color.Transparent;
     BindingContext  = new BaseViewModel(Navigation)
     {
         Title = TextResources.x4ever,
         Icon  = TextResources.logo_transparent
     };
     VisitedPages = new VisitedPages();
     Initial();
 }
Exemplo n.º 2
0
        private void MoveToPage(int newPageIndex, int activePageIndex = -1)
        {
            if (activePageIndex < 0)
            {
                activePageIndex = ActivePageIndex;
            }
            if (newPageIndex < 0 || newPageIndex >= Pages.Count)
            {
                return;
            }
            Pages[activePageIndex].IsActive = false;
            var newPage = Pages[newPageIndex];

            newPage.IsActive = true;
            VisitedPages.Add(newPage);

            OnPropertyChanged(nameof(ActivePage));
            OnPropertyChanged(nameof(ActivePageIndex));
            OnPropertyChanged(nameof(IsOnLastPage));
        }