Beispiel #1
0
        public MovieBrowserViewModel(IMovieCatalogServiceAgent catalogServiceAgent)
        {
            Genres = new ObservableCollection <Genre>();
            catalogServiceAgent.InitiateGenreRetrieval(Genres.Add);

            SelectGenreCommand = new DelegateCommand(
                arg =>
            {
                var genre     = (Genre)arg;
                SelectedGenre = genre;
                RaiseViewGenre(genre);
            },
                arg =>
            {
                return(arg is Genre);
            });

            SelectTitleCommand = new DelegateCommand(
                arg =>
            {
                var title     = (Title)arg;
                SelectedTitle = title;
                SelectedGenre = Genres.Where(g => g.Titles.Contains(title)).FirstOrDefault();
                RaiseViewTitle(title);
            },
                arg =>
            {
                return(arg is Title);
            });
        }
 private void LoadGenres(IMovieCatalogServiceAgent catalogServiceAgent)
 {
     Genres = new ObservableCollection <Genre>();
     catalogServiceAgent.InitiateGenreRetrieval(Genres.Add);
 }
 public MovieBrowserViewModel(IMovieCatalogServiceAgent catalogServiceAgent)
 {
     LoadGenres(catalogServiceAgent);
     DefineNavigationCommands();
 }
 public MovieBrowserViewModel(IMovieCatalogServiceAgent catalogServiceAgent)
 {
     LoadGenres(catalogServiceAgent);
     DefineNavigationCommands();
 }
 private void LoadGenres(IMovieCatalogServiceAgent catalogServiceAgent)
 {
     Genres = new ObservableCollection<Genre>();
     catalogServiceAgent.InitiateGenreRetrieval(Genres.Add);
 }