Esempio n. 1
0
        private NavigationView SetupNavigationView(NavigationViewPaneDisplayMode paneDisplayMode = NavigationViewPaneDisplayMode.Auto)
        {
            NavigationView navView = null;

            RunOnUIThread.Execute(() =>
            {
                navView = new NavigationView();
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Undo", Icon = new SymbolIcon(Symbol.Undo)
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Cut", Icon = new SymbolIcon(Symbol.Cut)
                });

                navView.PaneTitle                  = "Title";
                navView.IsBackButtonVisible        = NavigationViewBackButtonVisible.Visible;
                navView.IsSettingsVisible          = true;
                navView.PaneDisplayMode            = paneDisplayMode;
                navView.OpenPaneLength             = 120.0;
                navView.ExpandedModeThresholdWidth = 600.0;
                navView.CompactModeThresholdWidth  = 400.0;
                navView.Width   = 800.0;
                navView.Height  = 600.0;
                navView.Content = "This is a simple test";
                Content         = navView;
                //Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
            });

            IdleSynchronizer.Wait();
            return(navView);
        }
Esempio n. 2
0
        private NavigationView SetupNavigationViewPaneContent(NavigationViewPaneDisplayMode paneDisplayMode = NavigationViewPaneDisplayMode.Auto)
        {
            NavigationView navView = null;

            RunOnUIThread.Execute(() =>
            {
                navView = new NavigationView();
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Undo", Icon = new SymbolIcon(Symbol.Undo)
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Cut", Icon = new SymbolIcon(Symbol.Cut)
                });

                // Navigation View Pane Elements
                Button headerButton  = new Button();
                headerButton.Content = "Header Button";

                Button footerButton  = new Button();
                footerButton.Content = "Footer Button";

                // NavigationView Content Elements
                Button contentButtonOne  = new Button();
                contentButtonOne.Content = "Content Button One";

                Button contentButtonTwo  = new Button();
                contentButtonTwo.Content = "Content Button Two";
                contentButtonTwo.Margin  = new Thickness(50, 0, 0, 0);

                StackPanel contentStackPanel = new StackPanel();
                contentStackPanel.Children.Add(contentButtonOne);
                contentStackPanel.Children.Add(contentButtonTwo);

                // Set NavigationView Properties

                navView.PaneHeader                 = headerButton;
                navView.PaneFooter                 = footerButton;
                navView.Header                     = "NavigationView Header";
                navView.AutoSuggestBox             = new AutoSuggestBox();
                navView.Content                    = contentStackPanel;
                navView.IsBackButtonVisible        = NavigationViewBackButtonVisible.Visible;
                navView.IsSettingsVisible          = true;
                navView.PaneDisplayMode            = paneDisplayMode;
                navView.OpenPaneLength             = 300.0;
                navView.ExpandedModeThresholdWidth = 600.0;
                navView.CompactModeThresholdWidth  = 400.0;
                navView.Width  = 800.0;
                navView.Height = 600.0;
                Content        = navView;
                Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
            });

            IdleSynchronizer.Wait();
            return(navView);
        }
Esempio n. 3
0
        private NavigationView SetupNavigationViewScrolling(NavigationViewPaneDisplayMode paneDisplayMode = NavigationViewPaneDisplayMode.Auto)
        {
            NavigationView navView = null;

            RunOnUIThread.Execute(() =>
            {
                navView = new NavigationView();
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #1", Icon = new SymbolIcon(Symbol.Undo)
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #2", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItemHeader()
                {
                    Content = "Item #3"
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #4", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #5", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItemSeparator());
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #7", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #8", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #9", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #10", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItemHeader()
                {
                    Content = "Item #11"
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #12", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #13", Icon = new SymbolIcon(Symbol.Cut)
                });
                navView.MenuItems.Add(new NavigationViewItemSeparator());
                navView.MenuItems.Add(new NavigationViewItem()
                {
                    Content = "Item #15", Icon = new SymbolIcon(Symbol.Cut)
                });

                navView.IsBackButtonVisible        = NavigationViewBackButtonVisible.Visible;
                navView.IsSettingsVisible          = true;
                navView.PaneDisplayMode            = paneDisplayMode;
                navView.OpenPaneLength             = 120.0;
                navView.ExpandedModeThresholdWidth = 600.0;
                navView.CompactModeThresholdWidth  = 400.0;
                navView.Width   = 800.0;
                navView.Height  = 200.0;
                navView.Content = "This test should have enough NavigationViewItems to scroll.";
                Content         = navView;
                //Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
                Application.Current.MainWindow.WindowState = WindowState.Maximized;
            });

            IdleSynchronizer.Wait();
            return(navView);
        }