Beispiel #1
0
        public ImageGifPage(PlanEntrenamientoEjercicios plan)
        {
            try
            {
                InitializeComponent();

                this.BindingContext = new PopModalEjerciciosPageViewModel(plan);
                var html = new HtmlWebViewSource();
                html.Html         = Helpers.HtmlHelper.getHtml(plan.Video, App.Ancho, App.Alto);
                WebViewGif.Source = html;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Beispiel #2
0
        private void OnSelectedEjercicios(PlanEntrenamientoEjercicios SelectedEjercicios)
        {
            try
            {
                if (SelectedEjercicios != null)
                {
                    if (string.IsNullOrEmpty(SelectedEjercicios.Photo) && string.IsNullOrEmpty(SelectedEjercicios.Photo))
                    {
                        //SelectedEjercicios.Video = "imagenotfound.png";
                        //App.MasterPageDetail.IsPresented = false;
                        //App.MasterPageDetail.Detail.Navigation.PushAsync(new ImageGifPage(SelectedEjercicios), true);
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(SelectedEjercicios.Video))
                        {
                            string[] images = { ".gif" };

                            if (images.Contains(Path.GetExtension(SelectedEjercicios.Video)))
                            {
                                App.MasterPageDetail.IsPresented = false;
                                App.MasterPageDetail.Detail.Navigation.PushAsync(new ImageGifPage(SelectedEjercicios), true);
                            }
                            else
                            {
                                App.MasterPageDetail.IsPresented = false;
                                App.MasterPageDetail.Detail.Navigation.PushAsync(new PopupEjercicios(SelectedEjercicios), true);
                            }
                        }
                        else
                        {
                            var image = ImageConvert.ConvertToBase(SelectedEjercicios.Photo);
                            SelectedEjercicios.ImageConvert  = image;
                            App.MasterPageDetail.IsPresented = false;
                            App.MasterPageDetail.Detail.Navigation.PushAsync(new ImageEjerciciosPage(SelectedEjercicios), true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
        public PopModalEjerciciosPageViewModel(PlanEntrenamientoEjercicios plan)
        {
            //webview solo acepta videos y .gif, si se quiere mostrar image se debe mostrar en un Image
            //si la extencion de imagen no esta en images, hay que agregar las extenciones de imagnes que se requiera
            try
            {
                Plan = new PlanEntrenamientoEjercicios();
                Plan = plan;

                var division   = App.Alto / 3;
                var altoformal = division + division;
                Plan.Ancho = App.Ancho;
                Plan.Alto  = altoformal;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
 public ImageEjerciciosPage(PlanEntrenamientoEjercicios plan)
 {
     InitializeComponent();
     this.BindingContext = new PopModalEjerciciosPageViewModel(plan);
 }