using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace C1_Demo
{
    public partial class DemoProgressBar : UserControl
    {
        public DemoProgressBar()
        {
            InitializeComponent();

            //Applies an animation to show a more lively sample.
            var storyboard = new Storyboard();
            var animation = new DoubleAnimation();
            animation.Duration = TimeSpan.FromSeconds(4);
            animation.From = 0;
            animation.To = 100;
            animation.RepeatBehavior = RepeatBehavior.Forever;
            animation.AutoReverse = true;
            animation.EasingFunction = new QuadraticEase() { EasingMode = EasingMode.EaseInOut };
            Storyboard.SetTarget(animation, progressBar);
            Storyboard.SetTargetProperty(animation, new PropertyPath("(C1ProgressBar.Value)"));
            storyboard.Children.Add(animation);
            storyboard.Begin();

        }
        #region ** ClearStyle properties

        public Brush DEMO_Background
        {
            get
            {
                return progressBar.Background;
            }
            set
            {
                progressBar.Background = value;
            }
        }

        public Brush DEMO_Foreground
        {
            get
            {
                return progressBar.Foreground;
            }
            set
            {
                progressBar.Foreground = value;
            }
        }

        public Brush DEMO_BorderBrush
        {
            get
            {
                return progressBar.BorderBrush;
            }
            set
            {
                progressBar.BorderBrush = value;
            }
        }

        public CornerRadius CornerRadius
        {
            get
            {
                return progressBar.CornerRadius;
            }
            set
            {
                progressBar.CornerRadius = value;
            }
        }

        public new Thickness DEMO_Padding
        {
            get
            {
                return progressBar.Padding;
            }
            set
            {
                progressBar.Padding = value;
            }
        }

        public Brush IndeterminateForeground
        {
            get
            {
                return progressBar2.IndeterminateForeground;
            }
            set
            {
                progressBar2.IndeterminateForeground = value;
            }
        }

        #endregion
    }
}
