Last active
December 17, 2015 19:58
-
-
Save bhameyie/5663797 to your computer and use it in GitHub Desktop.
deserializing using JSon.NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void OnMovieFound(string content) | |
{ | |
var movie = JsonConvert.DeserializeObject<Movie>(content); | |
if (movie != null && movie.Response == "True") | |
{ | |
this.movieTitleTextBlock.Text = movie.Title; | |
this.plotTextBlock.Text = movie.Plot; | |
this.ratingTextBlock.Text = movie.Rating; | |
this.releasedDattetextBlock.Text = movie.Released; | |
this.runtimetextBlock.Text = movie.Runtime; | |
this.posterImage.Source = new BitmapImage(new Uri(movie.Poster)); | |
} | |
else | |
{ | |
MessageBox.Show(string.Format("No movie could be found for Movie titled {0}", searchTextBox.Text)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment