Many people prefer to see checkboxes instead of the highlighting in a list box. There is a way to do this in XAML that does not require any change in ItemsSource, such as a property to bind to the IsChecked property of the Checkbox.
The following is an example of the XAML that will replace the highlighting of ListBoxItem with a
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="SnapsToDevicePixels" Value="true" />
It requires the replacement of the
Template with a simple
Template where the
ContentPresenter is just contained in a
CheckBox which has its
IsChecked property bound to the
IsSelectedProperty. One of the things that this Template does is remove the
Triggers that do the highlighting. Instead the highlighting depends on the
Triggers for the
- 10/11/2017: Initial version
Has been working as a C# developer on contract for the last several years, including 3 years at Microsoft. Previously worked with Visual Basic and Microsoft Access VBA, and have developed code for Word, Excel and Outlook. Started working with WPF in 2007 when part of the Microsoft WPF team. For the last eight years has been working primarily as a senior WPF/C# and Silverlight/C# developer. Currently working as WPF developer with BioNano Genomics in San Diego, CA redesigning their UI for their camera system. he can be reached at email@example.com.