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 void SettingButton_Click(object sender, RoutedEventArgs e) { ListViewMenu.UnselectAll(); }