Beispiel #1
0
        public GifViewCell()
        {
            InitializeComponent();
            Video.MediaStateChanged += (sender, args) =>
            {
                if (args.State == MediaState.Loaded)
                {
                    Thumbnail.IsVisible         = false;
                    ActivityIndicator.IsVisible = false;
                }

                //if (args.State == MediaState.Finished)
                //{
                //    Video.Play();
                //}

                if (args.State != MediaState.Playing)
                {
                    PlayButton.Text = "fa-play-circle";
                    PlayButton.FadeTo(1, easing: Easing.Linear);
                }
                else
                {
                    PlayButton.Text = "fa-pause-circle";
                    PlayButton.FadeTo(0, easing: Easing.Linear);
                }
            };

            Thumbnail.Success += (sender, args) =>
            {
                GifPanel.HeightRequest = GifPanel.Width * args.ImageInformation.CurrentHeight / args.ImageInformation.CurrentWidth;
            };

            PlayButton.Clicked -= OnPlayButtonClicked;
            PlayButton.Clicked += OnPlayButtonClicked;
        }