I have a fundamental question:
Let's say I have a List of elements of some class. And I also have a DataGrid that displays the properties of the items of this list. I want a user to select some items via the extra checkbox column (datagridtemplatecolumn in fact). Then he presses the button and only selected items are processed by some function. How should I implement the logic of this checkbox?
Should I add a boolean property to my class and bind it to the checkbox column? (I think, it's not good to add an extra property to my core class just for the sake of UI)
Should I make some wrapper class that has a boolean property and bind DataGrid to the list of wrapper class? (Better complies to the OOP rules than the first variant)
Make an unbound checkbox column. And then check the datagrid rows in the loop to gather selected items before processing. (This is what I wanted to do, but unbound checkbox column behaves really strange : when I toggle one checkbox, a couple of others are toggled as well. And I also didn't find a way to look through all the Rows of the DataGrid).
Your variant...
And I want to do that stuff according to OOP rules. This is the main requirement. That's why I cannot accept the first variant, unless you say me that it's OK and commonly used.