Uisng the WPF UI Template I dont see how one adds child menu items? #713
Unanswered
thehockeylabmn
asked this question in
Q&A
Replies: 3 comments 3 replies
-
Hey @thehockeylabmn , if you are using the latest preview, you can create a submenu with code like this: NavigationItems = new ObservableCollection<object>
{
new NavigationViewItem()
{
Content = "My main menu",
Icon = new SymbolIcon { Symbol = SymbolRegular.Fluent24 },
MenuItems = new object[]
{
new NavigationViewItem("Sub menu item 1", SymbolRegular.Fluent24, typeof(MySubMenuPage1)),
new NavigationViewItem("Sub menu item 2", SymbolRegular.Fluent24, typeof(MySubMenuPage2))
}
}
}; |
Beta Was this translation helpful? Give feedback.
2 replies
-
@pomianowski im on 2.0.3 what is the lattest preview and how does one get it thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to be able to add sub menu items to the model how does one do that for example the sales would have child items of Orders , Invoice, Recept?
NavigationItems = new ObservableCollection
{
new NavigationItem()
{
Content = "Home",
PageTag = "dashboard",
Icon = SymbolRegular.Home24,
PageType = typeof(Views.Pages.DashboardPage)
}, new NavigationItem()
{
Content = "Sales",
PageTag = "sales",
Icon = SymbolRegular.CurrencyDollarEuro24,
PageType = typeof(Views.Pages.SalesOrderPage)
}, new NavigationItem()
{
Content = "Invoice",
PageTag = "invoice",
Icon = SymbolRegular.Receipt24,
PageType = typeof(Views.Pages.DashboardPage)
}, new NavigationItem()
{
Content = "Drivers",
PageTag = "drivers",
Icon = SymbolRegular.Receipt24,
PageType = typeof(Views.Pages.DashboardPage)
}, new NavigationItem()
{
Content = "Routes",
PageTag = "routes",
Icon = SymbolRegular.Receipt24,
PageType = typeof(Views.Pages.DashboardPage)
}, new NavigationItem()
{
Content = "Drivers Progress",
PageTag = "driversprogress",
Icon = SymbolRegular.VehicleTruck24,
PageType = typeof(Views.Pages.DashboardPage)
}, new NavigationItem()
{
Content = "Warehouse",
PageTag = "warehouse",
Icon = SymbolRegular.VehicleTruckCube24,
PageType = typeof(Views.Pages.DashboardPage)
}
, new NavigationItem()
{
Content = "Pick Lists",
PageTag = "picklists",
Icon = SymbolRegular.List24,
PageType = typeof(Views.Pages.DashboardPage)
};
Beta Was this translation helpful? Give feedback.
All reactions