|
- using Smobiler.Core;
- using Smobiler.Core.Controls;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Text;
- namespace myapp
- {
- ////ToolboxItem用于控制是否添加自定义控件到工具箱,true添加,false不添加
- [System.ComponentModel.ToolboxItem(true)]
-
- partial class fontview : Smobiler.Core.Controls.MobileUserControl
- {
-
- private List<fontviewGroup> group = new List<fontviewGroup>();
- [Category("自定义"), Description("数据集")]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Content), MergableProperty(false)]
- [TypeConverter(typeof(System.ComponentModel.CollectionConverter))]
- [Editor(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public List<fontviewGroup> Groups
- {
- get { return group; }
- set { group = value;}/*此处set没有执行*/
- }
- //[Serializable]
- public class fontviewGroup
- {
- [Description("数量"), Browsable(true)]
- public int shl { get; set; }
- [Description("事件名"), Browsable(true)]
- private string name = "";
- public string Name {
- get {return name; }
- set { name = value; }
- }
- [Description("字体大小"), Browsable(true)]
- public int fontsize { get; set; }
- [Description("字体颜色"), Browsable(true)]
- public string fontcolor { get; set; }
- }
- public fontview() : base()
- {
- //This call is required by the SmobilerUserControl.
- InitializeComponent();
- Mycontrol(Groups);
- }
-
- public void Mycontrol(List<fontviewGroup> data)
- {
- Toast("input");
- foreach(fontviewGroup v in data)
- {
- Toast(v.Name);
- }
- }
-
- }
-
- }
复制代码 这是我控件里的定义属性,如何获得控件属性框groups集合的值呢?修改了没有反应
|
|