From 7b31f120e66138b9ef884252a1d3e66123ba3d29 Mon Sep 17 00:00:00 2001 From: Jan Karger Date: Sun, 14 Jan 2018 14:17:55 +0100 Subject: [PATCH 1/2] Set a selected Item only if there is no content set --- .../Controls/HamburgerMenu/HamburgerMenu.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/MahApps.Metro/MahApps.Metro.Shared/Controls/HamburgerMenu/HamburgerMenu.cs b/src/MahApps.Metro/MahApps.Metro.Shared/Controls/HamburgerMenu/HamburgerMenu.cs index 2d5ad28b96..91d52814b7 100644 --- a/src/MahApps.Metro/MahApps.Metro.Shared/Controls/HamburgerMenu/HamburgerMenu.cs +++ b/src/MahApps.Metro/MahApps.Metro.Shared/Controls/HamburgerMenu/HamburgerMenu.cs @@ -76,6 +76,11 @@ public override void OnApplyTemplate() private void HamburgerMenu_Loaded(object sender, RoutedEventArgs e) { + if (GetValue(ContentProperty) != null) + { + return; + } + var selectedItem = _buttonsListView?.SelectedItem ?? _optionsListView?.SelectedItem; if (selectedItem != null) { From 206fe13c523c52091bcb76bdd9ef1c0bad8fee02 Mon Sep 17 00:00:00 2001 From: Jan Karger Date: Sun, 14 Jan 2018 14:20:20 +0100 Subject: [PATCH 2/2] Add `HamburgerMenu` resources to Control styles to allow style manipulation and fix binding expression infos --- src/MahApps.Metro/MahApps.Metro/Styles/Controls.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.xaml index 2964ed3e0c..e09d3c122d 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.xaml @@ -38,6 +38,7 @@ +