private void MyListBox_OnDoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { var lighties = MyListBox.SelectedItems; if (lighties.Count <= HueConnector.Lights.Count / 2) { MyListBox.SelectAll(); } else { MyListBox.SelectedIndex = -1; } }
private void PreviweWindow_PreviewKeyDown(object sender, KeyEventArgs e) { switch (Keyboard.Modifiers) { case ModifierKeys.None: switch (e.Key) { case Key.Delete: RemoveItem(); break; default: break; } break; case ModifierKeys.Alt: break; case ModifierKeys.Control: switch (e.Key) { case Key.A: MyListBox.SelectAll(); break; case Key.C: CopyImage(); break; case Key.S: SaveImage(MyListBox.SelectedItems); break; default: break; } break; case ModifierKeys.Shift: break; case ModifierKeys.Windows: break; default: break; } }
private void MyContextItemSelectAll_Click(object sender, RoutedEventArgs e) { MyListBox.SelectAll(); }