private void QueueCommand(ViewModel.Command Command) { if (!this.CommandQueue.Contains(Command)) { this.CommandQueue.Add(Command); } }
internal void CacheCommand(ViewModel.Command Command) { lock (this.CommandCacheLock) { if (!this.CommandCache.ContainsKey(Command.ID)) { // Store Command in Cache this.CommandCache[Command.ID] = Command; // Queue Command this.QueueCommand(Command); // Link to Event for when CanExecute Changes Command.CanExecuteChanged += Command_CanExecuteChanged; } } }
public Command(ViewModel.Command Command) { this.ID = ViewModel.Utilities.GuidToString(Command.ID); this.CanExecute = Command.CanExecute; }
private void Command_CanExecuteChanged(object sender, EventArgs e) { ViewModel.Command command = (ViewModel.Command)sender; this.QueueCommand(command); }