/// <summary> /// Returns whether the action can be executed. /// </summary> /// <returns> /// A boolean representing whether the action can be executed. /// </returns> public bool CanExecute() { if (!_pinnedLocations.Contains(_pinnedLocation)) { return(true); } if (_pinnedLocations.IndexOf(_pinnedLocation) == 0) { return(false); } return(true); }
/// <summary> /// Executes the action. /// </summary> public void ExecuteDo() { _existingIndex = _pinnedLocations.IndexOf(_pinnedLocation); _pinnedLocations.Remove(_pinnedLocation); }