I went with very simple..
<DataGridCheckBoxColumn Binding="{Binding IsChecked, Mode=TwoWay}" IsReadOnly="False">
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<CheckBox Checked="FieldDataGridChecked" Unchecked="FieldDataGridUnchecked" Margin="2" />
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn>
Just handle the checked and unchecked events, and apply the "checked" to the model.
private void FieldDataGridChecked(object sender, RoutedEventArgs e)
{
foreach (FieldViewModel model in _fields)
{
model.IsChecked = true;
}
}
private void FieldDataGridUnchecked(object sender, RoutedEventArgs e)
{
foreach (FieldViewModel model in _fields)
{
model.IsChecked = false;
}
}