private async Task SendReport()
        {
            ProgressLayer.Visibility      = Visibility.Visible;
            ProgressRing.IsActive         = true;
            ProgressMessageTextBlock.Text = "Wysyłanie raportu";
            BottomAppBar.Visibility       = Visibility.Collapsed;

            try
            {
                Model.Json.Report report         = new Model.Json.Report(DescriptionTextBlock.Text, photos.Count, (product != null && product.Id != null) ? (long)product.Id : 0);
                ReportResponse    reportResponse = await PolaClient.CreateReport(report);

                if (photos.Count > 0 && reportResponse.SignedRequests.Length > 0)
                {
                    int count = Math.Min(photos.Count, reportResponse.SignedRequests.Length);
                    for (int i = 0; i < count; i++)
                    {
                        var ignore = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            ProgressMessageTextBlock.Text = string.Format("Wysyłanie zdjęć {0} z {1}", i + 1, photos.Count);
                        });
                        ReportPhoto photo     = photos[i];
                        string      uploadUri = reportResponse.SignedRequests[i][0];

                        if (photo.Bitmap != null)
                        {
                            await PolaClient.UploadImage(uploadUri, photo.Bitmap);
                        }
                    }
                }

                ProgressRing.IsActive         = false;
                ProgressMessageTextBlock.Text = string.Empty;
                if (product != null)
                {
                    product.IsReported = true;
                }

                MessageDialog dialog = new MessageDialog("Twoje zgłoszenie zostało wysłane i będzie rozpatrzone przez naszą redakcję.", "Pola");
                dialog.Commands.Add(new UICommand("ok")
                {
                    Id = 0,
                });
                dialog.CancelCommandIndex  = 0;
                dialog.DefaultCommandIndex = 0;
                await dialog.ShowAsync();

                Frame.GoBack();
            }
            catch
            {
                if (Frame.CurrentSourcePageType == typeof(Report))
                {
                    ProgressLayer.Visibility = Visibility.Collapsed;
                    ProgressRing.IsActive    = false;

                    MessageDialog dialog = new MessageDialog("Wystąpił błąd podczas wysyłania raportu. Spróbuj ponownie później.", "Błąd");
                    var           ignore = dialog.ShowAsync();
                    BottomAppBar.Visibility = Visibility.Visible;
                }
            }
        }
        private async Task SendReport()
        {
            ProgressLayer.Visibility = Visibility.Visible;
            ProgressRing.IsActive = true;
            ProgressMessageTextBlock.Text = "Wysyłanie raportu";
            BottomAppBar.Visibility = Visibility.Collapsed;

            try
            {
                Model.Json.Report report = new Model.Json.Report(DescriptionTextBlock.Text, photos.Count, (product != null && product.Id != null) ? (long)product.Id : 0);
                ReportResponse reportResponse = await PolaClient.CreateReport(report);

                if (photos.Count > 0 && reportResponse.SignedRequests.Length > 0)
                {
                    int count = Math.Min(photos.Count, reportResponse.SignedRequests.Length);
                    for (int i = 0; i < count; i++)
                    {
                        var ignore = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                        {
                            ProgressMessageTextBlock.Text = string.Format("Wysyłanie zdjęć {0} z {1}", i + 1, photos.Count);
                        });
                        ReportPhoto photo = photos[i];
                        string uploadUri = reportResponse.SignedRequests[i][0];

                        if (photo.Bitmap != null)
                            await PolaClient.UploadImage(uploadUri, photo.Bitmap);
                    }
                }

                ProgressRing.IsActive = false;
                ProgressMessageTextBlock.Text = string.Empty;
                if (product != null)
                    product.IsReported = true;

                MessageDialog dialog = new MessageDialog("Twoje zgłoszenie zostało wysłane i będzie rozpatrzone przez naszą redakcję.", "Pola");
                dialog.Commands.Add(new UICommand("ok") { Id = 0, });
                dialog.CancelCommandIndex = 0;
                dialog.DefaultCommandIndex = 0;
                await dialog.ShowAsync();
                Frame.GoBack();
            }
            catch
            {
                if (Frame.CurrentSourcePageType == typeof(Report))
                {
                    ProgressLayer.Visibility = Visibility.Collapsed;
                    ProgressRing.IsActive = false;

                    MessageDialog dialog = new MessageDialog("Wystąpił błąd podczas wysyłania raportu. Spróbuj ponownie później.", "Błąd");
                    var ignore = dialog.ShowAsync();
                    BottomAppBar.Visibility = Visibility.Visible;
                }
            }
        }