* UIAnalogMeter: 增加ValueChanged事件
This commit is contained in:
parent
9b38d5a32a
commit
c112b98c66
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -40,6 +40,8 @@ namespace Sunny.UI
|
|||||||
/// Class for the analog meter control
|
/// Class for the analog meter control
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ToolboxItem(true)]
|
[ToolboxItem(true)]
|
||||||
|
[DefaultEvent("ValueChanged")]
|
||||||
|
[DefaultProperty("Value")]
|
||||||
public class UIAnalogMeter : UIControl
|
public class UIAnalogMeter : UIControl
|
||||||
{
|
{
|
||||||
#region Enumerator
|
#region Enumerator
|
||||||
@ -186,6 +188,8 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event EventHandler ValueChanged;
|
||||||
|
|
||||||
[
|
[
|
||||||
Category("Behavior"),
|
Category("Behavior"),
|
||||||
Description("Value of the data"),
|
Description("Value of the data"),
|
||||||
@ -203,8 +207,12 @@ namespace Sunny.UI
|
|||||||
if (val < minValue)
|
if (val < minValue)
|
||||||
val = minValue;
|
val = minValue;
|
||||||
|
|
||||||
currValue = val;
|
if (currValue != val)
|
||||||
Invalidate();
|
{
|
||||||
|
currValue = val;
|
||||||
|
Invalidate();
|
||||||
|
ValueChanged?.Invoke(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user