using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kingo.Plugin.MapView.Enum;
namespace Kingo.Plugin.MapView.Model
{
    /// 
    /// 属性联动配置类
    /// 
    public class Linkage
    {
        /// 
        /// 源属性名
        /// 
        public string SourcePropertyName { get; set; }
        /// 
        /// 目标属性名
        /// 
        public string TargetPropertyName { get; set; }
        /// 
        /// 源属性名
        /// 
        public string SourcePropertyAliasName { get; set; }
        /// 
        /// 目标属性名
        /// 
        public string TargetPropertyAliasName { get; set; }
        /// 
        /// 联动类型
        /// 
        public EnumLinkageType LinkageType { get; set; }
        private string _DisplayPath;
        /// 
        /// 显示字段(初始化字典绑定)
        /// 
        public string DisplayMemberPath
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_DisplayPath))
                    return "NAME";
                return _DisplayPath;
            }
            set
            {
                _DisplayPath = value;
            }
        }
        private string _ValuePath;
        /// 
        /// 值字段(初始化字典绑定)
        /// 
        public string ValuePath
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_ValuePath))
                    return "CODE";
                return _ValuePath;
            }
            set
            {
                _ValuePath = value;
            }
        }
        /// 
        /// 如果是下拉框,是否需要分组
        /// 
        public bool IsGroup { get; set; }
        public bool IsReadOnly { get; set; }
        public string SourcePropertyValue { get; set; }
        public string TargetPropertyValue { get; set; }
        /// 
        /// 目标字段值是否使用源字段值
        /// 
        public bool IsSourceValue { get; set; } = false;
    }
}