Permalink
Browse files

Merge branch 'punker76-HamburgerMenu-Content-Binding-fix' into develop

  • Loading branch information...
punker76 committed Jan 27, 2017
2 parents 7fcc6b7 + ae0f648 commit a1d199dd599fa9f46838d6449599b36c7035f76e
@@ -55,6 +55,7 @@
Margin="20"
Foreground="White"
HamburgerWidth="48"
Content="{Binding RelativeSource={RelativeSource Self}, Mode=OneWay, Path=SelectedItem}"
ItemClick="HamburgerMenu_OnItemClick"
ItemTemplate="{StaticResource HamburgerMenuImageItem}"
OptionsItemClick="HamburgerMenu_OnOptionsItemClick"
@@ -13,7 +13,15 @@ public HamburgerMenuSample()
private void HamburgerMenu_OnItemClick(object sender, ItemClickEventArgs e)
{
HamburgerMenuControl.Content = e.ClickedItem;
// instead using binding Content="{Binding RelativeSource={RelativeSource Self}, Mode=OneWay, Path=SelectedItem}"
// we can do this
//HamburgerMenuControl.Content = e.ClickedItem;
// close the menu if a item was selected
if (this.HamburgerMenuControl.IsPaneOpen)
{
this.HamburgerMenuControl.IsPaneOpen = false;
}
}
private async void HamburgerMenu_OnOptionsItemClick(object sender, ItemClickEventArgs e)
@@ -70,7 +70,7 @@ public override void OnApplyTemplate()
private void HamburgerMenu_Loaded(object sender, RoutedEventArgs e)
{
this.Content = _buttonsListView?.SelectedItem ?? _optionsListView?.SelectedItem;
this.SetCurrentValue(ContentProperty, _buttonsListView?.SelectedItem ?? _optionsListView?.SelectedItem);
}
}
}

0 comments on commit a1d199d

Please sign in to comment.