I'm trying to create a check/uncheck all CheckBox
for a number of CheckBoxes
that are located inside the cell template of a GridViewColumn
. I added this column to a GridView
(along with other columns), set the GridView
to the view property of a ListView
, and then databound the ListView
to a collection of custom DataObjects
. So, each row of the ListView
has a column that contains a checkbox as well as columns bound to property paths of the bound object.
I would like to create the check/uncheck all CheckBox
by binding the IsChecked
property of the CheckBoxes
, but I do not want to change the data object the ListView
is bound to. My first attempt was to bind the ListView to a Dictionary<DataObject,Boolean>
and then bind the IsChecked
property to the Value
of the Dictionary
and the other columns to Key
.DataObjectProperty
. Then, I simply toggled the Values
of the Dictionary when then check/uncheck all CheckBox
was clicked. The binding to worked properly, but apparently dictionaries don't support change notification so the CheckBoxes
were never updated.
Does anyone have any suggestions as to the best way to solve this problem?