using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CustomControls
{
    /// <summary>
    /// Interakční logika pro DiodeControl.xaml
    /// </summary>
    public partial class DiodeControl : UserControl
    {
        public DiodeControl()
        {
            InitializeComponent();
            LayoutRoot.DataContext = this;
        }


        public static readonly DependencyProperty RedProperty = DependencyProperty.Register("RedLight", typeof(bool), typeof(DiodeControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Journal | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, null, true, UpdateSourceTrigger.PropertyChanged));

        public bool RedLight
        {
            get { return (bool)GetValue(RedProperty); }
            set { SetValueDp(RedProperty, value); }
        }

        public static readonly DependencyProperty GreenProperty = DependencyProperty.Register("GreenLight", typeof(bool), typeof(DiodeControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Journal | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, null, true, UpdateSourceTrigger.PropertyChanged));

        public bool GreenLight
        {
            get { return (bool)GetValue(GreenProperty); }
            set { SetValueDp(GreenProperty, value); }
        }

        public static readonly DependencyProperty BlueProperty = DependencyProperty.Register("BlueLight", typeof(bool), typeof(DiodeControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Journal | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, null, true, UpdateSourceTrigger.PropertyChanged));

        public bool BlueLight
        {
            get { return (bool)GetValue(BlueProperty); }
            set { SetValueDp(BlueProperty, value); }
        }

        public static readonly DependencyProperty OrangeProperty = DependencyProperty.Register("OrangeLight", typeof(bool), typeof(DiodeControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Journal | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, null, true, UpdateSourceTrigger.PropertyChanged));

        public bool OrangeLight
        {
            get { return (bool)GetValue(OrangeProperty); }
            set { SetValueDp(OrangeProperty, value); }
        }

        public static readonly DependencyProperty YellowProperty = DependencyProperty.Register("YellowLight", typeof(bool), typeof(DiodeControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Journal | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, null, true, UpdateSourceTrigger.PropertyChanged));

        public bool YellowLight
        {
            get { return (bool)GetValue(YellowProperty); }
            set { SetValueDp(YellowProperty, value); }
        }

        public static readonly DependencyProperty WhiteProperty = DependencyProperty.Register("WhiteLight", typeof(bool), typeof(DiodeControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Journal | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, null, true, UpdateSourceTrigger.PropertyChanged));

        public bool WhiteLight
        {
            get { return (bool)GetValue(WhiteProperty); }
            set { SetValueDp(WhiteProperty, value); }
        }

        public static readonly DependencyProperty GrayProperty = DependencyProperty.Register("GrayLight", typeof(bool), typeof(DiodeControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Journal | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, null, true, UpdateSourceTrigger.PropertyChanged));

        public bool GrayLight
        {
            get { return (bool)GetValue(GrayProperty); }
            set { SetValueDp(GrayProperty, value); }
        }



        public event PropertyChangedEventHandler PropertyChanged;
        void SetValueDp(DependencyProperty property, object value, [System.Runtime.CompilerServices.CallerMemberName] string p = null)
        {
            SetCurrentValue(property, value);
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(p));
        }
    }
}
