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;
using C1.Silverlight.Extended;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using C1.Silverlight;

namespace C1Extended_Demo
{
    public enum ReflectorEffects
    {
        None,
        Opacity,
        Blur,
        OpacityAndBlur
    };

    public partial class DemoReflector : UserControl
    {
        public double RotationX
        {
            get
            {
                return projection.RotationX;
            }
            set
            {
                projection.RotationX = value;
            }
        }

        public double RotationY
        {
            get
            {
                return projection.RotationY;
            }
            set
            {
                projection.RotationY = value;
            }
        }

        public double RotationZ
        {
            get
            {
                return projection.RotationZ;
            }
            set
            {
                projection.RotationZ = value;
            }
        }


        public bool ShowReflection
        {
            get
            {
                return reflector.ShowReflection;
            }
            set
            {
                reflector.ShowReflection = value;
            }
        }

        ReflectorEffects _effects = ReflectorEffects.Opacity;
        public ReflectorEffects Effects
        {
            get { return _effects; }
            set
            {
                _effects = value;
                reflector.ReflectionEffects.Clear();
                switch (value)
                {
                    case ReflectorEffects.Opacity:
                        reflector.ReflectionEffects.Add(new ReflectionOpacityEffect());
                        break;
                    case ReflectorEffects.Blur:
                        reflector.ReflectionEffects.Add(new BlurEffect());
                        break;
                    case ReflectorEffects.OpacityAndBlur:
                        reflector.ReflectionEffects.Add(new BlurEffect());
                        reflector.ReflectionEffects.Add(new ReflectionOpacityEffect());
                        break;
                }
            }
        }

        public DemoReflector()
        {
            InitializeComponent();

            image.Source = new BitmapImage(Extensions.GetAbsoluteUri("Resources/america.jpg"));
        }
    }
}
