I have the following XAML:
<ListView x:Name="debitOrderItems" ItemsSource="{Binding DebitOrderItems}">
<ListView.ItemTemplate>
<DataTemplate>
<CheckBox x:Name="checkbox" Content="{Binding}" IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}, Path=IsSelected}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Binding a list of items works fine and I get a beautiful listview with checkboxes, but I would like to have them all selected immediately. There is a SelectAll() method on the ListView, but when can I call it? DataContextChanged does not work as I link it before I populat the DebitOrderItems on it.