Ejemplo n.º 1
0
        private async void UploadButtonClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var uploadItem = UploadStoryUc.UploadItem;
                if (uploadItem == null)
                {
                    Helper.ShowNotify("Please select at least one image or video.", 5500);
                    return;
                }
                if (UploadStoryUc.Editing)
                {
                    Helper.ShowNotify("Your photo/video needs edit, edit it first and then try again.", 5500);
                    return;
                }
                ConvertionGrid.Visibility = Visibility.Visible;
                LoadingUc.Start();
                var converted = await Convertions.ConvertFilesAsync(new List <StorageUploadItem> {
                    uploadItem
                });

                ConvertionGrid.Visibility = Visibility.Collapsed;
                LoadingUc.Stop();
                var su = new StorageUpload();
                su.SetUploadItem(converted, "");
                Helper.ShowNotify("Convertion is done now you can use Minista\r\n" +
                                  "We will upload your media(s) to story in background.", 6000);
                Helpers.NavigationService.GoBack();
            }
            catch { }
        }
Ejemplo n.º 2
0
        private async void UploadButtonClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (UploadUcList.Count == 0)
                {
                    Helper.ShowNotify("Please select at least one image or video.", 5500);
                    return;
                }
                int  index   = 0;
                bool editing = false;
                int  ix      = 0;
                foreach (var item in UploadUcList)
                {
                    if (item.Editing)
                    {
                        editing = true;
                        index   = ix;
                        break;
                    }
                    ix++;
                }
                if (editing)
                {
                    Helper.ShowNotify("Some of your photo(s)/video(s) needs edit, edit them first and then try again.", 5500);
                    LV.SelectedIndex = index;
                    //FlipView.SelectedIndex = index;
                    return;
                }
                var list = new List <StorageUploadItem>();
                foreach (var item in UploadUcList)
                {
                    list.Add(item.UploadItem);
                }
                ConvertionGrid.Visibility = Visibility.Visible;
                LoadingUc.Start();
                var converted = await Convertions.ConvertFilesAsync(list);

                ConvertionGrid.Visibility = Visibility.Collapsed;
                LoadingUc.Stop();
                var su = new StorageUpload();
                su.SetUploadItem(converted, CaptionText.Text);
                Helper.ShowNotify("Convertion is done now you can use Minista\r\n" +
                                  "We will upload your media(s) in background.", 6000);
                Helpers.NavigationService.GoBack();
            }
            catch { }
        }
Ejemplo n.º 3
0
        private async void UploadButtonClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (UploadUcListX.Count == 0)
                {
                    Helper.ShowNotify("Please select at least one image or video.", 5500);
                    return;
                }
                int  index   = 0;
                bool editing = false;
                int  ix      = 0;
                //foreach (var item in UploadUcList)
                //{
                //    if (item.Editing)
                //    {
                //        editing = true;
                //        index = ix;
                //        break;
                //    }
                //    ix++;
                //}

                foreach (var item in UploadUcListX)
                {
                    if (item.PlusVisibility == Visibility.Collapsed)
                    {
                        if (item.UploadUc.Editing)
                        {
                            editing = true;
                            index   = ix;
                            break;
                        }
                        ix++;
                    }
                }
                if (editing)
                {
                    Helper.ShowNotify("Some of your photo(s)/video(s) needs edit, edit them first and then try again.", 5500);
                    //LV.SelectedIndex = index;
                    CPresenter.Content = UploadUcListX[index].UploadUc;
                    //FlipView.SelectedIndex = index;
                    return;
                }
                var list = new List <StorageUploadItem>();

                foreach (var item in UploadUcListX)
                {
                    if (item.PlusVisibility == Visibility.Collapsed)
                    {
                        var itemX = item.UploadUc.UploadItem;
                        itemX.Location        = CurrentLocation;
                        itemX.DisableComments = ToggleTurnOffCommenting.IsOn;
                        list.Add(itemX);
                    }
                }
                ConvertionGrid.Visibility = Visibility.Visible;
                LoadingUc.Start();
                var converted = await Convertions.ConvertFilesAsync(list);

                ConvertionGrid.Visibility = Visibility.Collapsed;
                LoadingUc.Stop();
                var su = new StorageUpload();
                su.SetUploadItem(converted, CaptionText.Text);
                Helper.ShowNotify("Convertion is done now you can use Minista\r\n" +
                                  "We will upload your media(s) in background.", 6000);

                ShowNextButton();
                Helpers.NavigationService.GoBack();
            }
            catch { }
        }