Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix submenu navigation in NavigationViewItem #759

Closed
6 changes: 4 additions & 2 deletions Settings.XamlStyler
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"SeparateByGroups": false,
"AttributeIndentation": 0,
"AttributeIndentationStyle": 1,
"RemoveDesignTimeReferences": false,
"RemoveDesignTimeReferences": false,
"IgnoreDesignTimeReferencePrefix": false,
"EnableAttributeReordering": true,
"AttributeOrderingRuleGroups": [
Expand Down Expand Up @@ -38,5 +38,7 @@
"ThicknessSeparator": 2,
"ThicknessAttributes": "Margin, Padding, BorderThickness, ThumbnailClipMargin",
"FormatOnSave": true,
"CommentPadding": 2
"CommentPadding": 2,
"IndentSize": 4,
"IndentWithTabs": false
}
23 changes: 12 additions & 11 deletions src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using System.Collections.ObjectModel;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using Wpf.Ui.Controls;
Expand Down Expand Up @@ -35,7 +36,7 @@ public partial class MainWindowViewModel : ObservableObject
{
Content = "Design guidance",
Icon = new SymbolIcon { Symbol = SymbolRegular.DesignIdeas24 },
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem("Typography", SymbolRegular.TextFont24, typeof(TypographyPage)),
new NavigationViewItem("Icons", SymbolRegular.Diversity24, typeof(IconsPage)),
Expand All @@ -46,7 +47,7 @@ public partial class MainWindowViewModel : ObservableObject
new NavigationViewItemSeparator(),
new NavigationViewItem("Basic Input", SymbolRegular.CheckboxChecked24, typeof(BasicInputPage))
{
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem(nameof(Anchor), typeof(AnchorPage)),
new NavigationViewItem(nameof(Wpf.Ui.Controls.Button), typeof(ButtonPage)),
Expand All @@ -68,7 +69,7 @@ public partial class MainWindowViewModel : ObservableObject
Content = "Collections",
Icon = new SymbolIcon { Symbol = SymbolRegular.Table24 },
TargetPageType = typeof(CollectionsPage),
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem(nameof(System.Windows.Controls.DataGrid), typeof(DataGridPage)),
new NavigationViewItem(nameof(ListBox), typeof(ListBoxPage)),
Expand All @@ -81,7 +82,7 @@ public partial class MainWindowViewModel : ObservableObject
},
new NavigationViewItem("Date & time", SymbolRegular.CalendarClock24, typeof(DateAndTimePage))
{
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem(nameof(CalendarDatePicker), typeof(CalendarDatePickerPage)),
new NavigationViewItem(nameof(System.Windows.Controls.Calendar), typeof(CalendarPage)),
Expand All @@ -91,7 +92,7 @@ public partial class MainWindowViewModel : ObservableObject
},
new NavigationViewItem("Dialogs & flyouts", SymbolRegular.Chat24, typeof(DialogsAndFlyoutsPage))
{
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem(nameof(Snackbar), typeof(SnackbarPage)),
new NavigationViewItem(nameof(ContentDialog), typeof(ContentDialogPage)),
Expand All @@ -102,15 +103,15 @@ public partial class MainWindowViewModel : ObservableObject
#if DEBUG
new NavigationViewItem("Layout", SymbolRegular.News24, typeof(LayoutPage))
{
MenuItems = new object[] { new NavigationViewItem("Expander", typeof(ExpanderPage)) }
MenuItems = new ObservableCollection<object> { new NavigationViewItem("Expander", typeof(ExpanderPage)) }
},
#endif
new NavigationViewItem
{
Content = "Media",
Icon = new SymbolIcon { Symbol = SymbolRegular.PlayCircle24 },
TargetPageType = typeof(MediaPage),
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem("Image", typeof(ImagePage)),
new NavigationViewItem("Canvas", typeof(CanvasPage)),
Expand All @@ -120,7 +121,7 @@ public partial class MainWindowViewModel : ObservableObject
},
new NavigationViewItem("Navigation", SymbolRegular.Navigation24, typeof(NavigationPage))
{
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem("BreadcrumbBar", typeof(BreadcrumbBarPage)),
new NavigationViewItem("NavigationView", typeof(NavigationViewPage)),
Expand All @@ -131,7 +132,7 @@ public partial class MainWindowViewModel : ObservableObject
},
new NavigationViewItem("Status & info", SymbolRegular.ChatBubblesQuestion24, typeof(StatusAndInfoPage))
{
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem("InfoBar", typeof(InfoBarPage)),
new NavigationViewItem("ProgressBar", typeof(ProgressBarPage)),
Expand All @@ -141,7 +142,7 @@ public partial class MainWindowViewModel : ObservableObject
},
new NavigationViewItem("Text", SymbolRegular.DrawText24, typeof(TextPage))
{
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem(nameof(AutoSuggestBox), typeof(AutoSuggestBoxPage)),
new NavigationViewItem(nameof(NumberBox), typeof(NumberBoxPage)),
Expand All @@ -154,7 +155,7 @@ public partial class MainWindowViewModel : ObservableObject
},
new NavigationViewItem("System", SymbolRegular.Desktop24, typeof(OpSystemPage))
{
MenuItems = new object[]
MenuItems = new ObservableCollection<object>
{
new NavigationViewItem("Clipboard", typeof(ClipboardPage)),
new NavigationViewItem("FilePicker", typeof(FilePickerPage)),
Expand Down
Loading
Loading