*UISwitch:增加是否只读属性
This commit is contained in:
parent
1677fc631e
commit
70c160dcfb
Binary file not shown.
@ -54,8 +54,8 @@ namespace Sunny.UI.Demo
|
||||
option.GreaterWarningArea = new UILineWarningArea(3.5);
|
||||
option.LessWarningArea = new UILineWarningArea(2.2, Color.Gold);
|
||||
|
||||
option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.Red, Name = "上限", Value = 3.5 });
|
||||
option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.Gold, Name = "下限", Value = 2.2 });
|
||||
option.YAxisScaleLines.Add(new UIScaleLine("上限", 3.5, Color.Red));
|
||||
option.YAxisScaleLines.Add(new UIScaleLine("下限", 2.2, Color.Gold));
|
||||
|
||||
option.XAxis.Name = "日期";
|
||||
option.YAxis.Name = "数值";
|
||||
|
@ -20,6 +20,7 @@
|
||||
* 2020-04-25: V2.2.4 更新主题配置类
|
||||
* 2021-05-06: V3.0.3 更新Active状态改变时触发ValueChanged事件
|
||||
* 2021-09-14: V3.0.7 增加Disabled颜色
|
||||
* 2022-01-02: V3.0.9 增加是否只读属性
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
@ -59,6 +60,10 @@ namespace Sunny.UI
|
||||
fillColor = Color.White;
|
||||
}
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否只读"), Category("SunnyUI")]
|
||||
public bool ReadOnly { get; set; }
|
||||
|
||||
private UISwitchShape switchShape = UISwitchShape.Round;
|
||||
|
||||
[Description("开关形状"), Category("SunnyUI")]
|
||||
@ -173,7 +178,7 @@ namespace Sunny.UI
|
||||
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
Active = !Active;
|
||||
if (!ReadOnly) Active = !Active;
|
||||
base.OnClick(e);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user