You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							247 lines
						
					
					
						
							6.6 KiB
						
					
					
				
			
		
		
	
	
							247 lines
						
					
					
						
							6.6 KiB
						
					
					
				using KGIS.Framework.Platform; | 
						|
using Kingo.Plugin.MapView.Enum; | 
						|
using System; | 
						|
using System.Collections.Generic; | 
						|
using System.ComponentModel; | 
						|
using System.Linq; | 
						|
using System.Text; | 
						|
using System.Threading.Tasks; | 
						|
 | 
						|
namespace Kingo.Plugin.MapView.Model | 
						|
{ | 
						|
    public class PropertyGridDataStruct : IPropertyStruct, INotifyPropertyChanged | 
						|
    { | 
						|
        public string HeaderToolTip { get; set; } | 
						|
 | 
						|
 | 
						|
        /// <summary> | 
						|
        /// 属性名(键) | 
						|
        /// </summary> | 
						|
        public string Key { get; set; } | 
						|
        public string FieldName { get; set; } | 
						|
 | 
						|
 | 
						|
        public string Text { get; set; } | 
						|
 | 
						|
        private string _SelectText; | 
						|
        public string SelectText | 
						|
        { | 
						|
            get | 
						|
            { | 
						|
                return _SelectText; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _SelectText = value; | 
						|
 | 
						|
                //if (PropertyChanged != null) | 
						|
                //    PropertyChanged(this, new PropertyChangedEventArgs("SelectText")); | 
						|
            } | 
						|
        } | 
						|
        /// <summary> | 
						|
        /// 显示字体颜色 | 
						|
        /// </summary> | 
						|
        private string _FontColor; | 
						|
        public string FontColor | 
						|
        { | 
						|
            get | 
						|
            { | 
						|
                return _FontColor; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _FontColor = value; | 
						|
                if (PropertyChanged != null) | 
						|
                    PropertyChanged(this, new PropertyChangedEventArgs("FontColor")); | 
						|
            } | 
						|
        } | 
						|
 | 
						|
        private string _Value; | 
						|
        /// <summary> | 
						|
        /// 属性值 | 
						|
        /// </summary> | 
						|
        public string Value | 
						|
        { | 
						|
            get | 
						|
            { | 
						|
                return _Value; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _Value = value; | 
						|
                if (PropertyChanged != null) | 
						|
                    PropertyChanged(this, new PropertyChangedEventArgs("Value")); | 
						|
            } | 
						|
        } | 
						|
 | 
						|
        public int KeyIndex { get; set; } | 
						|
        public int ValueIndex { get; set; } | 
						|
 | 
						|
        /// <summary> | 
						|
        /// 属性类型 | 
						|
        /// </summary> | 
						|
        public enumPropertyType PropertyType { get; set; } | 
						|
        /// <summary> | 
						|
        /// 字典Code;当PropertyType=ComboBox时必填 | 
						|
        /// </summary> | 
						|
        public string DicCode { get; set; } | 
						|
        private List<DataDicTionary> _DicData; | 
						|
        public List<DataDicTionary> DicData | 
						|
        { | 
						|
            //get | 
						|
            //{ | 
						|
            //    return _DicData; | 
						|
            //} | 
						|
            //set | 
						|
            //{ | 
						|
            //    _DicData = value; | 
						|
            //    //if (PropertyChanged != null) | 
						|
            //    //{ | 
						|
            //    //    PropertyChanged(this, new PropertyChangedEventArgs("DicData")); | 
						|
            //    //} | 
						|
            //} | 
						|
            get | 
						|
            { | 
						|
                return _DicData; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _DicData = value; | 
						|
                if (BaseDicData == null || BaseDicData.Count <= 0) | 
						|
                { | 
						|
                    BaseDicData = value; | 
						|
                } | 
						|
                if (PropertyChanged != null) | 
						|
                { | 
						|
                    PropertyChanged(this, new PropertyChangedEventArgs("DicData")); | 
						|
                } | 
						|
            } | 
						|
        } | 
						|
        private string _DisplayPath; | 
						|
        /// <summary> | 
						|
        /// 显示字段(初始化字典绑定) | 
						|
        /// </summary> | 
						|
        public string DisplayMemberPath | 
						|
        { | 
						|
            get | 
						|
            { | 
						|
                if (string.IsNullOrWhiteSpace(_DisplayPath)) | 
						|
                    return "NAME"; | 
						|
                return _DisplayPath; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _DisplayPath = value; | 
						|
                //if (PropertyChanged != null) | 
						|
                //{ | 
						|
                //    PropertyChanged(this, new PropertyChangedEventArgs("DisplayMemberPath")); | 
						|
                //} | 
						|
            } | 
						|
        } | 
						|
        private string _ValuePath; | 
						|
        /// <summary> | 
						|
        /// 值字段(初始化字典绑定) | 
						|
        /// </summary> | 
						|
        public string ValuePath | 
						|
        { | 
						|
            get | 
						|
            { | 
						|
                if (string.IsNullOrWhiteSpace(_ValuePath)) | 
						|
                    return "CODE"; | 
						|
                return _ValuePath; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _ValuePath = value; | 
						|
                //if (PropertyChanged != null) | 
						|
                //{ | 
						|
                //    PropertyChanged(this, new PropertyChangedEventArgs("ValuePath")); | 
						|
                //} | 
						|
            } | 
						|
        } | 
						|
        private bool _IsReadOnly; | 
						|
        /// <summary> | 
						|
        /// 是否只读 | 
						|
        /// </summary> | 
						|
        public bool IsReadOnly | 
						|
        { | 
						|
            get | 
						|
            { | 
						|
                return _IsReadOnly; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _IsReadOnly = value; | 
						|
                if (PropertyChanged != null) | 
						|
                { | 
						|
                    PropertyChanged(this, new PropertyChangedEventArgs("IsReadOnly")); | 
						|
                } | 
						|
            } | 
						|
        } | 
						|
        /// <summary> | 
						|
        /// 允许空值 | 
						|
        /// </summary> | 
						|
        public bool AllowNull { get; set; } | 
						|
        /// <summary> | 
						|
        /// 表示下拉框是否需要分组(树形)显示 | 
						|
        /// </summary> | 
						|
        public bool IsGroup { get; set; } | 
						|
        public bool CheckBoxValue { get; set; } | 
						|
        public bool Visible { get; set; } | 
						|
        public int Order { get; set; } | 
						|
 | 
						|
 | 
						|
        private List<string> _MultiSelectDicData; | 
						|
        public List<string> MultiSelectDicData | 
						|
        { | 
						|
            get | 
						|
            { | 
						|
                return _MultiSelectDicData; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _MultiSelectDicData = value; | 
						|
                //if (PropertyChanged != null) | 
						|
                //{ | 
						|
                //    PropertyChanged(this, new PropertyChangedEventArgs("MultiSelectDicData")); | 
						|
                //} | 
						|
            } | 
						|
        } | 
						|
 | 
						|
        public event PropertyChangedEventHandler PropertyChanged;// = delegate { }; | 
						|
        public List<DataDicTionary> BaseDicData | 
						|
        { | 
						|
            get; | 
						|
            set; | 
						|
        } | 
						|
 | 
						|
 | 
						|
        private List<object> _SelectedItems; | 
						|
        /// <summary> | 
						|
        /// 多选下拉选定 | 
						|
        /// </summary> | 
						|
        public List<object> SelectedItems | 
						|
        { | 
						|
            get | 
						|
            { | 
						|
                return _SelectedItems; | 
						|
            } | 
						|
            set | 
						|
            { | 
						|
                _SelectedItems = value; | 
						|
                if (PropertyChanged != null) | 
						|
                    PropertyChanged(this, new PropertyChangedEventArgs("SelectedItems")); | 
						|
            } | 
						|
        } | 
						|
    } | 
						|
    public interface IPropertyStruct | 
						|
    { | 
						|
        string Key { get; set; } | 
						|
        string Value { get; set; } | 
						|
        List<DataDicTionary> DicData { get; set; } | 
						|
        string DisplayMemberPath { get; set; } | 
						|
        string ValuePath { get; set; } | 
						|
        bool IsReadOnly { get; set; } | 
						|
        bool Visible { get; set; } | 
						|
    } | 
						|
}
 | 
						|
 |