private async void btnAddPicture_Click(object sender, RoutedEventArgs e) { try { pictureName = await FilePicker.FilePickerAsync(); if (pictureName != null) { byte[] picture = await AzureStorageService.GetPictureAsync(pictureName); imageAdd.Source = await ByteArrayToImageAsync(picture); } } catch { } }
private async Task GetIssue(int detailId) { try { List <Issue> issue = GetDataService.GetIssueDetailsAsync(detailId).GetAwaiter().GetResult(); foreach (var i in issue) { List <Picture> picture = new List <Picture>(); tbxIssue.Text = i.Issue1; tbxIssueDate.Text = i.IssueTime.ToString(); tbxCustomer.Text = i.Customer.CustomerName; tbxId.Text = $"Issue id: {i.IssueId}";; tbxCategory.Text = i.Category.Category1; tbxSituation.Text = i.Situation.Situation1; picture = i.Picture.ToList(); if (picture != null) { try { foreach (var p in picture) { byte[] pic = await AzureStorageService.GetPictureAsync(p.Picture1.ToString()); imageDetail.Source = await ByteArrayToImageAsync(pic); } } catch { } } var comms = i.Comment.ToList(); if (comms != null) { foreach (var c in comms) { comments.Add(c); } } } } catch { } }