private async void OnSelectedItemChanged(HamburgerItem selectedItem) { var item = selectedItem; if (item != null) { if (SelectedBottomItem == item) { SelectedTopItem = null; } else { SelectedBottomItem = null; } if (item != _previouslySelectedItem) { if (!item.CanBeSelected) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { SelectedItem = _previouslySelectedItem; item.RaiseClickEvent(this); }); // TODO: Improve } else { var copy = ItemChanged; if (copy != null) { copy(this, new HamburgerItemChangedEventArgs(item)); } item.RaiseSelectedEvent(this); item.RaiseClickEvent(this); if (item.AutoClosePane) { IsPaneOpen = false; } _previouslySelectedItem = item; } } } else { _previouslySelectedItem = item; } }
private async void OnSelectedItemChanged(HamburgerItem selectedItem) { var item = selectedItem; if (item != null) { if (SelectedBottomItem == item) SelectedTopItem = null; else SelectedBottomItem = null; if (item != _previouslySelectedItem) { if (!item.CanBeSelected) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { SelectedItem = _previouslySelectedItem; item.RaiseClickEvent(this); }); // TODO: Improve } else { var copy = ItemChanged; if (copy != null) copy(this, new HamburgerItemChangedEventArgs(item)); item.RaiseSelectedEvent(this); item.RaiseClickEvent(this); if (item.AutoClosePane) IsPaneOpen = false; _previouslySelectedItem = item; } } } else _previouslySelectedItem = item; }
/// <summary>Initializes a new instance of the <see cref="HamburgerItemChangedEventArgs"/> class.</summary> /// <param name="item">The item.</param> public HamburgerItemChangedEventArgs(HamburgerItem item) { Item = item; }