private void ButtonRemoveAll_Click(object sender, RoutedEventArgs e) { foreach (var ddc in StateControl.Instance.AvailableDataHolders) { CheckedItemHelper.SetIsChecked(ddc, false); } }
private void ButtonRemoveSelected_Click(object sender, RoutedEventArgs e) { var copy = SelectedColumnOrderListBox.SelectedItems.Cast <DataColumn>().ToList(); foreach (var column in copy) { CheckedItemHelper.SetIsChecked(column, false); } }
private void AddRemoveCheckedItems() { foreach (var ddc in StateControl.Instance.AvailableDataHolders) { foreach (var column in ddc.Columns) { var chkd = (bool)CheckedItemHelper.GetIsChecked(column); if (chkd && !StateControl.Instance.Columns.Contains(column)) { StateControl.Instance.Columns.Add(column); } else if (!chkd && StateControl.Instance.Columns.Contains(column)) { StateControl.Instance.Columns.Remove(column); } } } }