private async void ListViewOption_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { await Task.Delay(100); ListViewMenu.UnselectAll(); if (ListViewOption.SelectedItem != null) { content.Children.Clear(); UserControl usc; switch (((ListViewItem)((ListView)sender).SelectedItem).Name) { case "ItemPengaturan": usc = new viewPengaturan(); content.Children.Add(usc); break; case "ItemLogout": var login = new Window_Login(); this.Close(); login.Show(); break; default: break; } } } catch (Exception ex) { MessageBox.Show("error di " + ex); } }
private async void HamburgerMenu_OnOptionsItemClick(object sender, ItemClickEventArgs e) { var menuItem = e.ClickedItem as HamburgerMenuItem; if (menuItem.Label == "Logout") { var login = new Window_Login(); this.Close(); login.Show(); } }