private void ExecutedAddNew(object sender, ExecutedRoutedEventArgs e) { ItemsGroupBox target = e.Source as ItemsGroupBox; if (target != null) { target.OnAddNew(e); } }
private void ExecutedSelectedNext(object sender, ExecutedRoutedEventArgs e) { ItemsGroupBox target = e.Source as ItemsGroupBox; if (target != null) { target.OnNextClicked(e); } }
private void CanExecuteSelectNext(object sender, CanExecuteRoutedEventArgs e) { ItemsGroupBox target = e.Source as ItemsGroupBox; if (target != null && target.Items != null) { e.CanExecute = target.SelectedIndex < target.Items.Count - 1; } else { e.CanExecute = false; } }
private void CanExecuteSelectPrevious(object sender, CanExecuteRoutedEventArgs e) { ItemsGroupBox target = e.Source as ItemsGroupBox; if (target != null) { e.CanExecute = target.SelectedIndex > 0; } else { e.CanExecute = false; } }
private void CanExecuteAddNew(object sender, CanExecuteRoutedEventArgs e) { ItemsGroupBox target = e.Source as ItemsGroupBox; if (target != null) { if (target.Content is IItemsGroupBoxDetailControl) { e.CanExecute = (target.Content as IItemsGroupBoxDetailControl).CanAddNew(); } else { e.CanExecute = true; } } else { e.CanExecute = false; } }
private void CanExecuteUnlock(object sender, CanExecuteRoutedEventArgs e) { ItemsGroupBox target = e.Source as ItemsGroupBox; if (target != null) { if (target.Content is IItemsGroupBoxDetailControl) { e.CanExecute = (target.Content as IItemsGroupBoxDetailControl).CanUnlock(); } else { e.CanExecute = (target.SelectedItem != null); } } else { e.CanExecute = false; } }
private void grpSubParts_IsUnlockedChanged(ItemsGroupBox obj, bool newValue) { var subpart = grpSubParts.SelectedItem as MaterialPartViewModel; if (subpart != null) { subpart.Locked = !newValue; } }