Ejemplo n.º 1
0
        private void NavigationView_SelectionChanged(object sender, HamburgerMenuSelectionChangedEventArgs args)
        {
            var selectedItem = (HamburgerMenuItem)args.SelectedItem;

            if (selectedItem != null && selectedItem != downloadItem && selectedItem != favoriteItem)
            {
                if (selectedItem == settingsItem)
                {
                    contentFrame.NavigateToType(typeof(SampleSettingsPage));
                }
                else
                {
                    string selectedItemTag = ((string)selectedItem.Tag);
                    ((HamburgerMenuEx)sender).Header = "Sample Page " + selectedItemTag.Substring(selectedItemTag.Length - 1);
                    string pageName = "SamplesCommon.SamplePages." + selectedItemTag;
                    Type   pageType = typeof(SamplePage1).Assembly.GetType(pageName);
                    contentFrame.NavigateToType(pageType);
                }
            }
        }
Ejemplo n.º 2
0
        private void NavigationView_SelectionChanged(object sender, HamburgerMenuSelectionChangedEventArgs args)
        {
            var selectedItem = (HamburgerMenuItem)args.SelectedItem;

            if (selectedItem != null && selectedItem != downloadItem && selectedItem != favoriteItem)
            {
                if (selectedItem == settingsItem)
                {
                    contentFrame.Navigate(SamplePageSources.SampleSettingsPage);
                }
                else
                {
                    string selectedItemTag = ((string)selectedItem.Tag);
                    ((HamburgerMenuEx)sender).Header = "Sample Page " + selectedItemTag.Substring(selectedItemTag.Length - 1);
                    string pageName   = selectedItemTag;
                    Uri    pageSource = SamplePageSources.GetUri(pageName);
                    contentFrame.Navigate(pageSource);
                }
            }
        }