public void CheckSelectAllOrSelectPos(int pos) { if (FileListBox.Items.Count > pos) { if (SelectAllCheckBox.IsChecked ?? false) { FileListBox.SelectAll(); } else { FileListBox.UnselectAll(); FileListBox.SelectedIndex = pos; } } }
private void SelectAllButton_Click(object sender, RoutedEventArgs e) { if (FileListBox.Items.Count == 0) { return; } if (FileListBox.SelectedItems.Count == 0) { FileListBox.SelectAll(); } else { FileListBox.UnselectAll(); } }