using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.OperationCenter;
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>
    /// MetalWaferSizeControl.xaml 的交互逻辑
    /// </summary>
    public partial class MetalWaferSizeControl : UserControl
    {
        public MetalWaferSizeControl()
        {
            InitializeComponent();
        }

        public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
          "ModuleName", typeof(string), typeof(MetalWaferSizeControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
        /// <summary>
        /// 模块名称
        /// </summary>
        public string ModuleName
        {
            get
            {
                return (string)this.GetValue(ModuleNameProperty);
            }
            set
            {
                this.SetValue(ModuleNameProperty, value);
            }
        }

        public static readonly DependencyProperty MetalWaferSizeProperty = DependencyProperty.Register(
           "MetalWaferSize", typeof(string), typeof(MetalWaferSizeControl), new FrameworkPropertyMetadata("200", FrameworkPropertyMetadataOptions.AffectsRender));
        /// <summary>
        /// MetalWaferSize
        /// </summary>
        public string MetalWaferSize
        {
            get
            {
                return (string)this.GetValue(MetalWaferSizeProperty);
            }
            set
            {
                this.SetValue(MetalWaferSizeProperty, value);
            }
        }

        private void WaferSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetMetalWaferSize", cbox.SelectedItem.ToString());
        }
    }
}