Esempio n. 1
0
 private void SetPageEntries()
 {
     int[] entriesPerPageAlternatives = new int[] { 5, 15, 30 };
     foreach (int entry in entriesPerPageAlternatives)
     {
         PageEntriesElementJson page = PageEntries.Add();
         page.Amount = entry;
         page.Text   = $"Show {entry} items per page";
     }
 }
        public OuterFrameViewModel(App currentApp, ApplicationFrame frame)
        {
            CurrentApp             = currentApp;
            GoBackCommand          = new RelayCommand(obj => GoBack(), obj => Frame.CanGoBack || (Page != null && Page.CanGoBack));
            ToggleMenuCommand      = new RelayCommand(obj => IsMenuOpen = !IsMenuOpen);
            NavigateBackCommand    = new RelayCommand(obj => Frame.GoBack(), obj => Frame.CanGoBack);
            NavigateForwardCommand = new RelayCommand(obj => Frame.GoForward(), obj => Frame.CanGoForward);
            Frame = frame;
            RegisterFrameEvents();
            RefreshPage();
            RefreshWindowWidth();

            Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;
            var titleBar = Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().TitleBar;

            titleBar.LayoutMetricsChanged  += TitleBar_LayoutMetricsChanged;
            RightControlsInset              = titleBar.SystemOverlayRightInset;
            CurrentApp.ContentWidthChanged += CurrentApp_ContentSizeChanged;
            //RefreshTitleElementSizes();

            PageEntries.Add(new HamburgerBarPageEntryViewModel(Frame, typeof(TransitMapPage), "Map", new FontFamily("Segoe UI Symbol"), 20, ""));
        }