-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Examining the source code of HamburgerMenu.cs really made my day, after look for many hours for a solution to just provide a simple content without using the contenttemplate (that makes data binding within "real" content views a hassle and could not get tit work in my case).
It has assigned (and re-assigned again within OnApplyTemplate() every time) a event handler to the Loaded event of the control to assign the SelectedItem (usually a inherited class of HamburgerMenuItem) to it's own Content Dependency property and so destroy the content grid "ContentGrid" I assigned via XAML like this:
<controls:HamburgerMenu x:Name="HamburgerMenuControl"> <controls:HamburgerMenu.Content> <Grid x:Name="ContentGrid">...
So: is this code really needed? Or is it just a "forgotten code fragment" from copied demo code ?
My current workaround/hack looks like this:
private void HamburgerMenu_OnItemClick(object sender, ItemClickEventArgs e) { ... HamburgerMenuControl.SetCurrentValue(HamburgerMenu.ContentProperty, ContentGrid); ...}
EDIT: Issue 3089 describes exactly the behavior of the problem above but a different use case.