Ejemplo n.º 1
0
 public FavoritesViewModel([NotNull] INavigationService navigationService,
                           [NotNull] FavoritedItemsManager favoritedItemsManager,
                           [NotNull] FlurryPublisher flurryPublisher)
 {
     if (navigationService == null)
     {
         throw new ArgumentNullException("navigationService");
     }
     if (favoritedItemsManager == null)
     {
         throw new ArgumentNullException("favoritedItemsManager");
     }
     if (flurryPublisher == null)
     {
         throw new ArgumentNullException("flurryPublisher");
     }
     _navigationService = navigationService;
     flurryPublisher.PublishPageLoadedFavorites();
     Items =
         new ObservableCollection <FavoritedItemViewModel>(
             favoritedItemsManager.GetFavorites().ToViewModels(_navigationService));
     AddCommand = new SimpleCommand(AddNewFavorite);
 }