using com.superscene.ui;
using System;
using System.Collections.Generic;
using System.Diagnostics;
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 parkMonitor.view.util {
	/// <summary></summary>
	public class TabMenu : TabControl {
		static TabMenu() {
			DefaultStyleKeyProperty.OverrideMetadata(typeof(TabMenu), new FrameworkPropertyMetadata(typeof(TabMenu)));
		}

		public TabMenu() {
			CmdClickHeadBtn = new SupRelayCommand(new Action(onClickHeadBtn));
			CmdClickScaleBtn = new SupRelayCommand(new Action(onClickScaleBtn));
		}

		//IsSmall
		public static readonly DependencyProperty IsSmallPro = DependencyProperty.Register("IsSmall", typeof(bool), typeof(TabMenu), new PropertyMetadata(true));
		public bool IsSmall {
			get { return (bool)GetValue(IsSmallPro); }
			set { SetCurrentValue(IsSmallPro, value); }
		}

		//IsFixed
		public static readonly DependencyProperty IsFixedPro = DependencyProperty.Register("IsFixed", typeof(bool), typeof(TabMenu), new PropertyMetadata(false));
		public bool IsFixed {
			get { return (bool)GetValue(IsFixedPro); }
			set { SetCurrentValue(IsFixedPro, value); }
		}

		//ShowHeight
		public static readonly DependencyProperty ShowHeightPro = DependencyProperty.Register("ShowHeight", typeof(double), typeof(TabMenu), new PropertyMetadata(25.0));
		public double ShowHeight {
			get { return (double)GetValue(ShowHeightPro); }
			set { SetCurrentValue(ShowHeightPro, value); }
		}

		//NormalHeight
		public static readonly DependencyProperty NormalHeightPro = DependencyProperty.Register("NormalHeight", typeof(double), typeof(TabMenu), new PropertyMetadata(120.0));
		public double NormalHeight {
			get { return (double)GetValue(NormalHeightPro); }
			set { SetCurrentValue(NormalHeightPro, value); }
		}

		//SmallHeight
		public static readonly DependencyProperty SmallHeightPro = DependencyProperty.Register("SmallHeight", typeof(double), typeof(TabMenu), new PropertyMetadata(25.0));
		public double SmallHeight {
			get { return (double)GetValue(SmallHeightPro); }
			set { SetCurrentValue(SmallHeightPro, value); }
		}

		//Command Click Head Button
		public static readonly DependencyProperty CmdClickHeadBtnProperty = DependencyProperty.Register("CmdClickHeadBtn", typeof(ICommand), typeof(TabMenu));
		public ICommand CmdClickHeadBtn {
			get { return (ICommand)GetValue(CmdClickHeadBtnProperty); }
			set { SetValue(CmdClickHeadBtnProperty, value); }
		}

		private void onClickHeadBtn() {
			//if(IsFixed) {
			//	IsSmall = false;
			//	return;
			//}
			//IsSmall = !IsSmall;
			IsFixed = true;
		}

		//Command Click Scale Button
		public static readonly DependencyProperty CmdClickScaleBtnProperty = DependencyProperty.Register("CmdClickScaleBtn", typeof(ICommand), typeof(TabMenu));
		public ICommand CmdClickScaleBtn {
			get { return (ICommand)GetValue(CmdClickScaleBtnProperty); }
			set { SetValue(CmdClickScaleBtnProperty, value); }
		}

		private void onClickScaleBtn() {
			IsFixed = !IsFixed;
			if(!IsFixed) {
				IsSmall = true;
			}
		}
	}
}
