private void OnCheckBox_Click(object sender, RoutedEventArgs e)
 {
     if (MaterialPool.Items.Count == MaterialPool.SelectedItems.Count)
     {
         MaterialPool.UnselectAll();
     }
     else
     {
         MaterialPool.SelectAll();
     }
 }
        private void OnMaterialPool_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // Hack to force 'UnselectedAll' after loading (default: 1st list item selected)
            if (((PlanningViewModel)DataContext).FirstLoading)
            {
                MaterialPool.UnselectAll();
                return;
            }

            if (MaterialPool.Items.Count > 0 && MaterialPool.Items.Count == MaterialPool.SelectedItems.Count)
            {
                HeaderListViewCheckbox.IsChecked = true;
            }
            else
            {
                HeaderListViewCheckbox.IsChecked = false;
            }
        }
 private void OnMaterialPool_Loaded(object sender, RoutedEventArgs e)
 {
     MaterialPool.UnselectAll();
     ((PlanningViewModel)DataContext).PlannerColumnCollection = ((GridView)PlannedItems.View).Columns;
 }