public void SearchFavouriteCameras(string query) { if (string.IsNullOrWhiteSpace(query)) { UpdateCameras(model.GetFavourites()); return; } cameras.Clear(); var searchedCameras = model.GetFavourites(); foreach (var camera in searchedCameras.Where(x => x.City.Contains(query) || x.Country.Contains(query))) { var cameraViewModel = new CameraViewModel(camera); cameras.Add(cameraViewModel); } }
public bool CanExecuteAddToFavouritesCommand() { return(!model.GetFavourites().Any(x => x.Id == this.Entity.Id)); }