コード例 #1
0
 public void GetMovieAsync(int id) {
     Movie m = new Movie();
     EventHandler<EventArgs> f = null;
     f = (s, ea) => {
         m.GetMovieCompleted -= f;
         OnGetMovieCompleted(m);
     };
     m.GetMovieCompleted += f;
     m.GetMovieAsync(id);
 }
コード例 #2
0
 protected virtual void OnGetMovieCompleted(Movie m) {
     if (GetMovieCompleted != null)
         GetMovieCompleted(this, new ResultEventArgs<Movie>(m));
 }
コード例 #3
0
 void rt_GetMovieCompleted(object sender, ResultEventArgs<Movie> e) {
     movie = e.Result;
     titleTextBlock.Text = movie.Title;
     yearTextBlock.Text = movie.Year.ToString();
     posterImage.Source = new BitmapImage(new Uri(movie.Posters.Original, UriKind.Absolute));
 }