using MECF.Framework.Common.OperationCenter;
using CyberX8_Core;
using System;
using System.Collections.Generic;
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 CyberX8_Themes.UserControls
{
    /// <summary>
    /// PufChuckControl.xaml 的交互逻辑
    /// </summary>
    public partial class PufChuckControl : UserControl
    {
        public PufChuckControl()
        {
            InitializeComponent();
        }


        public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register("ModuleName", typeof(string), typeof(PufChuckControl));
        /// <summary>
        /// ModuleName
        /// </summary>
        public string ModuleName
        {
            get
            {
                return (string)this.GetValue(ModuleNameProperty);
            }
            set
            {
                this.SetValue(ModuleNameProperty, value);
            }
        }

        public static readonly DependencyProperty ChuckProperty = DependencyProperty.Register( "Chuck", typeof(bool), typeof(PufChuckControl));
        /// <summary>
        /// Chuck
        /// </summary>
        public bool Chuck
        {
            get
            {
                return (bool)this.GetValue(ChuckProperty);
            }
            set
            {
                this.SetValue(ChuckProperty, value);
            }
        }

        public static readonly DependencyProperty SideAChuckOutProperty = DependencyProperty.Register("SideAChuckOut", typeof(bool), typeof(PufChuckControl));
        /// <summary>
        /// SideAChuckOut
        /// </summary>
        public bool SideAChuckOut
        {
            get
            {
                return (bool)this.GetValue(SideAChuckOutProperty);
            }
            set
            {
                this.SetValue(SideAChuckOutProperty, value);
            }
        }

        public static readonly DependencyProperty SideBChuckOutProperty = DependencyProperty.Register("SideBChuckOut", typeof(bool), typeof(PufChuckControl));
        /// <summary>
        /// SideBChuckOut
        /// </summary>
        public bool SideBChuckOut
        {
            get
            {
                return (bool)this.GetValue(SideBChuckOutProperty);
            }
            set
            {
                this.SetValue(SideBChuckOutProperty, value);
            }
        }

        public static readonly DependencyProperty SideAChuckInProperty = DependencyProperty.Register("SideAChuckIn", typeof(bool), typeof(PufChuckControl));
        /// <summary>
        /// SideAChuckIn
        /// </summary>
        public bool SideAChuckIn
        {
            get
            {
                return (bool)this.GetValue(SideAChuckInProperty);
            }
            set
            {
                this.SetValue(SideAChuckInProperty, value);
            }
        }

        public static readonly DependencyProperty SideBChuckInProperty = DependencyProperty.Register("SideBChuckIn", typeof(bool), typeof(PufChuckControl));
        /// <summary>
        /// SideBChuckIn
        /// </summary>
        public bool SideBChuckIn
        {
            get
            {
                return (bool)this.GetValue(SideBChuckInProperty);
            }
            set
            {
                this.SetValue(SideBChuckInProperty, value);
            }
        }

        private void ChuckOn_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ChuckOn");
        }

        private void ChuckOff_Click(object sender, RoutedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ChuckOff");
        }
    }
}