コード例 #1
0
        void RestoreState(object parameter, PageStateStorage storage)
        {
            List <string> savedNavigationHistory;

            if (storage.TryGetParameter("DemoNavigationHistory", out savedNavigationHistory))
            {
                navigationHistory = savedNavigationHistory;
            }
            ;
            object hamburgerMenuItemGroupName = navigationHistory == null ? parameter : navigationHistory[navigationHistory.Count - 1];

            SelectHamburgerMenuItemByParameter(hamburgerMenuItemGroupName);
            if (hamburgerMenuItemGroupName.Equals(parameter))
            {
                return;
            }
            DemoModuleViewModel demoModule = DemoModules.FirstOrDefault(x => x.DemoModule.ViewTypeName.Equals(parameter));

            if (demoModule != null)
            {
                UpdateFilteredDemoModules(demoModule);
                NavigationLevel         = NavigationLevel.DemoModule;
                SelectedDemoModuleIndex = storage.GetParameter("SelectedDemoModuleIndex", SelectedDemoModuleIndex);
            }
            else
            {
                NavigationLevel = NavigationLevel.Main;
                Navigate("MainPage", MainScreenId);
            }
        }
コード例 #2
0
        void ISupportSaveLoadState.LoadState(object navigationParameter, PageStateStorage pageState)
        {
            var item = SampleDataSource.GetItem(pageState.GetParameter("SelectedItem", (string)navigationParameter));

            SelectedItem = item;
        }