using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace PDF_Office.ViewModels.Form
{
    public enum FormAttributeType
    {
        Name,
        ToolTip,
        IsReadOnly,
        IsRequiredField,
        IsLocked,
        //外观
        BorderThiness,
        IsSolid,
        WidthSize,
        HeightSize,
        BorderColor,
        ContentColor
    }
    public class FormBaseVM : BindableBase
    {
        #region 触发事件
        public event EventHandler<FormAttributeType> ChangeValueHandler;
        #endregion

        #region 一般
        //提示
        private string _toolTipStr;
        public string ToolTipStr
        {
            get { return _toolTipStr; }
            set { SetProperty(ref _toolTipStr, value); ChangeValueHandler?.Invoke(value, FormAttributeType.ToolTip); }
        }

        //名称
        private string _nameStr;
        public string NameStr
        {
            get { return _nameStr; }
            set { SetProperty(ref _nameStr, value); ChangeValueHandler?.Invoke(value, FormAttributeType.Name); }
        }

        //只读
        public bool _isReadOnly = false;
        public bool IsReadOnly
        {
            get { return _isReadOnly; }
            set { SetProperty(ref _isReadOnly, value); ChangeValueHandler?.Invoke(value, FormAttributeType.IsReadOnly); }
        }

        //必填
        public bool _isRequiredField = false;
        public bool IsRequiredField
        {
            get { return _isRequiredField; }
            set { SetProperty(ref _isRequiredField, value); ChangeValueHandler?.Invoke(value, FormAttributeType.IsRequiredField); }
        }

        //锁定
        public bool _isLocked = false;
        public bool IsLocked
        {
            get { return _isLocked; }
            set { SetProperty(ref _isLocked, value); ChangeValueHandler?.Invoke(value, FormAttributeType.IsLocked); }
        }

        #endregion

        #region 外观
        //边框大小
        private double _borderThiness = 0;
        public double BorderThiness
        {
            get { return _borderThiness; }
            set { SetProperty(ref _borderThiness, value); ChangeValueHandler?.Invoke(value, FormAttributeType.BorderThiness); }
        }

        //是否为实线条
        private ComPDFKit.PDFAnnotation.C_BORDER_STYLE _isSolid = ComPDFKit.PDFAnnotation.C_BORDER_STYLE.BS_SOLID;
        public ComPDFKit.PDFAnnotation.C_BORDER_STYLE IsSolid
        {
            get { return _isSolid; }
            set { SetProperty(ref _isSolid, value); ChangeValueHandler?.Invoke(value, FormAttributeType.IsSolid); }
        }

        //宽大小
        private double _widthSize = 150;
        public double WidthSize
        {
            get { return _widthSize; }
            set { SetProperty(ref _widthSize, value); ChangeValueHandler?.Invoke(value, FormAttributeType.WidthSize); }
        }

        //高大小
        private double _heightSize = 22;
        public double HeightSize
        {
            get { return _heightSize; }
            set { SetProperty(ref _heightSize, value); ChangeValueHandler?.Invoke(value, FormAttributeType.HeightSize); }
        }

        //边框颜色
        private Color _borderColor = Colors.Transparent;
        public Color BorderColor
        {
            get { return _borderColor; }
            set { SetProperty(ref _borderColor, value); ChangeValueHandler?.Invoke(value, FormAttributeType.BorderColor); }
        }


        //内容颜色
        private Color _contentColor = Colors.Transparent;
        public Color ContentColor
        {
            get { return _contentColor; }
            set { SetProperty(ref _contentColor, value); ChangeValueHandler?.Invoke(value, FormAttributeType.ContentColor); }
        }

        #endregion
    }

    public class ResetColor: BindableBase
    {
        private SolidColorBrush _borderColor;
        public SolidColorBrush BorderColor
        {
            get { return _borderColor; }
            set { SetProperty(ref _borderColor, value); }
        }

        private SolidColorBrush _fontColor;
        public SolidColorBrush FontColor
        {
            get { return _fontColor; }
            set { SetProperty(ref _fontColor, value); }
        }


        private SolidColorBrush _fillColor;
        public SolidColorBrush FillColor
        {
            get { return _fillColor; }
            set { SetProperty(ref _fillColor, value); }
        }
    }
}
