public CommandProvider(MacUI app, CommandProvider parent) { App = app; IsEnabled = new BooleanProperty("IsEnabled", true); CanStart = new BooleanProperty("CanStart", true); CanStop = new BooleanProperty("CanStop", false); notifyCanExecute = new NotifyStateChanged(IsEnabled, CanStart); if (parent != null) { notifyCanExecute.Register(parent.NotifyHasInstance); } stopCommand = new StopCommand(this); }
public StopCommand(CommandProvider provider) : base(provider, provider.CanStop) { }
protected Command(CommandProvider provider, INotifyStateChanged notify) { Provider = provider; NotifyStateChanged = notify; }