public void CustomizeView(SelectionBase <TSelection, TResult> model, NodeView nodeView) { Model = model; SelectCommand = new DelegateCommand(() => Model.Select(null), Model.CanBeginSelect); var selectionControl = new ElementSelectionControl { DataContext = this }; nodeView.inputGrid.Children.Add(selectionControl); }
public void CustomizeView(SelectionBase <TSelection, TResult> model, NodeView nodeView) { Model = model; SelectCommand = new DelegateCommand(() => Model.Select(null), Model.CanBeginSelect); Model.PropertyChanged += (s, e) => { if (e.PropertyName == "CanSelect") { SelectCommand.RaiseCanExecuteChanged(); } }; var selectionControl = new ElementSelectionControl { DataContext = this }; nodeView.inputGrid.Children.Add(selectionControl); }