using MECF.Framework.Common.ProcessCell;
using MECF.Framework.Common.Reservior;
using PunkHPX8_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 PunkHPX8_Themes.UserControls
{
    /// 
    /// ReserviorControl.xaml 的交互逻辑
    /// 
    public partial class ReserviorControl : UserControl
    {
        public ReserviorControl()
        {
            InitializeComponent();
        }
        public static readonly DependencyProperty ReserviorWidthProperty = DependencyProperty.Register("ReserviorWidth", typeof(int), typeof(ReserviorControl));
        /// 
        /// 宽度
        /// 
        public int ReserviorWidth
        {
            get
            {
                return (int)this.GetValue(ReserviorWidthProperty);
            }
            set
            {
                this.SetValue(ReserviorWidthProperty, value);
            }
        }
        public static readonly DependencyProperty ReserviorNameProperty = DependencyProperty.Register("ReserviorName", typeof(string), typeof(ReserviorControl));
        /// 
        /// 名称
        /// 
        public string ReserviorName
        {
            get
            {
                return (string)this.GetValue(ReserviorNameProperty);
            }
            set
            {
                this.SetValue(ReserviorNameProperty, value);
            }
        }
        public static readonly DependencyProperty ReserviorInfoProperty = DependencyProperty.Register("ReserviorInfo", typeof(ReserviorInfo), typeof(ReserviorControl),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
        /// 
        /// Reservior对象
        /// 
        public ReserviorInfo ReserviorInfo
        {
            get
            {
                return (ReserviorInfo)this.GetValue(ReserviorInfoProperty);
            }
            set
            {
                this.SetValue(ReserviorInfoProperty, value);
            }
        }
        private void Canvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            GlobalEvents.OnSwitchFixedTabItem("HardWare", "Reservoirs", $"{ReserviorName}");
        }
    }
}