public RecipeWindow(string id) { InitializeComponent(); rc = _request.GetRecipe(id); using (var client = new HttpClient()) { BitmapImage img = new BitmapImage(); img.BeginInit(); img.UriSource = new Uri(rc.Recipe.ImageURI, UriKind.RelativeOrAbsolute); img.CacheOption = BitmapCacheOption.OnLoad; img.EndInit(); Img.Source = img; } foreach (var ingr in rc.Recipe.Ingredients) { TextBlock tb = new TextBlock(); tb.FontSize = 20; tb.TextWrapping = TextWrapping.Wrap; Stack.Children.Add(tb); tb.Text = ingr; } Hyper.NavigateUri = rc.Recipe.DetailsURL; nametxt.Text = rc.Recipe.Name; rate.Text += Math.Round(rc.Recipe.Rating); }
private Recipe Request(object RecipeId) { return(_request.GetRecipe(RecipeId.ToString()).Recipe); }