* 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
|
||||
/// </summary>
|
||||
[ToolboxItem(true)]
|
||||
[DefaultEvent("ValueChanged")]
|
||||
[DefaultProperty("Value")]
|
||||
public class UIAnalogMeter : UIControl
|
||||
{
|
||||
#region Enumerator
|
||||
@ -186,6 +188,8 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler ValueChanged;
|
||||
|
||||
[
|
||||
Category("Behavior"),
|
||||
Description("Value of the data"),
|
||||
@ -203,8 +207,12 @@ namespace Sunny.UI
|
||||
if (val < minValue)
|
||||
val = minValue;
|
||||
|
||||
currValue = val;
|
||||
Invalidate();
|
||||
if (currValue != val)
|
||||
{
|
||||
currValue = val;
|
||||
Invalidate();
|
||||
ValueChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user