Skip to content

Instantly share code, notes, and snippets.

@bhameyie
Last active December 17, 2015 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhameyie/5663797 to your computer and use it in GitHub Desktop.
Save bhameyie/5663797 to your computer and use it in GitHub Desktop.
deserializing using JSon.NET
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