![windows 10 selected items not highlighted windows 10 selected items not highlighted](https://www.intowindows.com/wp-content/uploads/2016/03/Thumbnails-now-showing-in-Windows-10-file-explorer-step1.png)
The SelectionChanged event can be fired by changes that occur as a result of changing the SelectionMode property. String current = (e.CurrentSelection.FirstOrDefault() as Monkey)?.Name String previous = (e.PreviousSelection.FirstOrDefault() as Monkey)?.Name
#Windows 10 selected items not highlighted code
In this code example, the OnCollectionViewSelectionChanged event handler is executed when the SelectionChanged event fires, with the event handler retrieving the previously selected item, and the current selected item: void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e) The equivalent C# code is: CollectionView collectionView = new CollectionViewĬollectionView.SetBinding(ItemsView.ItemsSourceProperty, "Monkeys") ĬollectionView.SelectionChanged += OnCollectionViewSelectionChanged The following XAML example shows a CollectionView that can respond to single item selection: When this property changes, the SelectionChangedCommand is executed (with the value of the SelectionChangedCommandParameter being passed to the ICommand), and the SelectionChanged event fires. When an item is selected, the SelectedItem property will be set to the value of the selected item. When the SelectionMode property is set to Single, a single item in the CollectionView can be selected. In addition, CollectionView has a UpdateSelectedItems method that updates the SelectedItems property with a list of selected items, while only firing a single change notification.