예제 #1
0
        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);
            }
        }
예제 #2
0
 public bool CanExecuteAddToFavouritesCommand()
 {
     return(!model.GetFavourites().Any(x => x.Id == this.Entity.Id));
 }