Starting with v2.1 of the Windows Community Toolkit, the HamburgerMenu provides a new property called UseNavigationViewWhenPossible. That is not needed with the NavigationView Some developers accomplished the same with the HamburgerMenu by re-templating it and writing a lot of custom code. AutoSuggestBox property allows you to add a search box that integrates directly with the NavigationView.The header is docked to the top of the page and acts as a scroll clipping point for the content area. Its purpose is to hold the page title of the selected nav category. There is a new optional header area that is vertically aligned with the navigation button and has a fixed height.You can use the new NavigationViewItem, NavigationViewItemSeparator and NavigationViewItemHeader to directly populate the MenuItems and get the look you wantĪdditional features in the NavigationView: The navigation view also introduces several new features that are not available in the HamburgerMenu: In addition, the NavigationView introduces new classes for quickly adding navigation items and grouping items. Items.Add(new MenuItem() įree-form content in the pane's footer, by adding any content in the new PaneFooter property Var menuItem = e.ClickedItem as MenuItem ĬontentFrame.Navigate(menuItem.PageType) Private void OnMenuItemClick(object sender, ItemClickEventArgs e) HamburgerMenuControl.OptionsItemsSource = MenuItem.GetOptionsItems() HamburgerMenuControl.ItemsSource = MenuItem.GetMainItems() Public sealed partial class MainPage : Page Using this Frame object, you can navigate to your pages by using the following code. Īs you can see below, we declared a Frame inside the HamburgerMenu control. This sample demonstrates how to add custom menu items to the HamburgerMenu control. Set true to use a template based on the NavigationView when running on the Fall Creators Update and above, and the regular template otherwiseĮvent raised when an options' item is clicked Gets or sets the selected options menu item Gets or sets the selected options menu index Gets or sets a value that specifies whether the pane is shown on the right or left side of the control Gets or sets the Brush to apply to the foreground of the Pane area of the control (specifically, the hamburger button foreground) Gets or sets the Brush to apply to the background of the Pane area of the control Gets or sets the visibility of the options menu Gets or sets the DataTemplateSelector used to display each item in the options Gets or sets the DataTemplate used to display each item in the options Gets or sets an object source used to generate the content of the options Gets the collection used to generate the content of the option list Gets or sets the width of the pane when it's fully expanded Gets or sets the DataTemplateSelector used to display each item Gets or sets the DataTemplate used to display each item Gets or sets an object source used to generate the content of the menu Gets the collection used to generate the content of the items list Gets or sets a value indicating whether gets or sets a value that specifies whether the pane is expanded to its full width Gets or sets a template for the hamburger icon Gets or sets a value that specifies how the pane and content areas are shown Gets or sets the width of the pane in its compact display mode When tapped, it displays additional feature pages, and user settings. An example of the HamburgerMenu is the MSN Money App included in Windows 10. The tiny icon takes up a minimal amount of screen real estate and creates a clean, minimalist look.ĭevelopers can place menu specific content, navigation, images, text or custom controls. The 3-line menu icon, which resembles a Hamburger, allows developers to pack more features into their apps or navigation. By tapping the icon, it opens up a side menu with a selection of options or additional pages. The HamburgerMenu Control provides an easy-to-use, side-bar menu which users can show or hide by using a Hamburger button. Read the Moving to NavigationView section for more info. The HamburgerMenu is no longer available in the Windows Community Toolkit.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |