Exemple #1
0
        private void UnselectAllListViewItems(params ListViewItem[] excepts)
        {
            var allListViewItems = CategoryListView.FindDescendants <ListViewItem>()
                                   .SelectMany(listViewItem => listViewItem.FindDescendants <ListViewItem>())
                                   .Union(CategoryListView.FindDescendants <ListViewItem>())
                                   .Except(excepts);

            foreach (var listViewItem in allListViewItems)
            {
                listViewItem.IsSelected = false;
            }
        }
Exemple #2
0
        private void SetListViewSelectionMode(ListViewSelectionMode listViewSelectionMode, params ListView[] excepts)
        {
            var listViews = CategoryListView.FindDescendants <ListView>()
                            .Union(new List <ListView> {
                CategoryListView
            })
                            .Except(excepts);

            foreach (var listView in listViews)
            {
                listView.SelectionMode = listViewSelectionMode;
            }
        }