示例#1
0
        void AddMovieExecute(MovieSearchResult movieSearchResult)
        {
            if (!movieSearchResult.IsValid())
            {
                Dialog.ShowMessage(String.Format("Movie is invalid.  Errors {0}", movieSearchResult.Error), "Invalid Data", DialogButton.OK, DialogImage.Exclamation);
                return;
            }
            Movie movie = new Movie(
                movieSearchResult.Name,
                movieSearchResult.Description,
                movieSearchResult.ImageURL,
                movieSearchResult.Image,
                movieSearchResult.Paid,
                movieSearchResult.Id,
                movieSearchResult.PurchasedFrom,
                movieSearchResult.Cast,
                movieSearchResult.PublicRating,
                movieSearchResult.YearReleased,
                movieSearchResult.MediaType,
                movieSearchResult.MyRating);

            MovieDataStoreService.Items.Add(movie);
            movieSearchResult.InLocalDatabase = true;
            MovieDataStoreService.Save();
        }
 void SaveExecute()
 {
     _orginalMovie.MyRating = Movie.MyRating;
     MovieDataStoreService.Save();
     CloseExecute();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BrowseStuffViewModel"/> class.
 /// </summary>
 public BrowseStuffViewModel()
 {
     MovieDataStoreService.Load();
     _searchResults = new ListCollectionView(MovieDataStoreService.Items);
     _searchResults.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
 }