You should consider using the MVVM pattern for your WPF application, and if you intend to use MVVM, you will need the MVVM framework .
Then this will be the case of creating a type that represents your data binding object (for example, Book ), and then a set of this type in your view model (for example, ObservableCollection<Book> Books ).
Then you would bind the Selected boolean boolean property, for example, in your Book type, to the CheckBox IsChecked property in the ItemBox ListBox.
<CheckBox IsChecked="{Binding Selected}" />
You may not want to declare your domain object ( Book ) properties that are purely used for the user interface ( Selected ), so you can create a BookViewModel type that adds a Book type and modifies the object for presentation purposes only.
devdigital
source share