using C1.Xaml.Imaging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236

namespace ImageSamplesLib2013
{
    public sealed partial class DemoGifImage : UserControl
    {
        C1GifImage _gifImage;
        bool _play = true;

        public DemoGifImage()
        {
            InitializeComponent();

            _gifImage = new C1GifImage(new Uri("ms-appx:///ImageSamplesLib2013/Resources/Babycha.gif"));
            image.Source = _gifImage;
        }

        public bool Play
        {
            get { return _play; }
            set
            {
                if (_play != value)
                {
                    _play = value;
                    if (_play)
                    {
                        _gifImage.Play();
                    }
                    else
                    {
                        _gifImage.Stop();
                    }
                }
            }
        }
    }
}
