Events
This article describes the Blazor Signature events and provides a runnable example with sample event handler implementations.
OnBlur
TheOnBlur
event fires when the Signature loses focus.
OnChange
TheOnChange
event represents a user action - confirmation of the current value. It fires when the user pressesEnter
, or when the component loses focus.
The
OnChange
event is a custom event and does not interfere with bindings, so you can use it together with models and forms.
ValueChanged
TheValueChanged
event fires when signature is fully drawn.
Example
Last event: @EventLog
@code { private string SignatureValue { get; set; } private string EventLog { get; set; } = "..."; private void ValueChangedHandler(string value) { SignatureValue = value; EventLog = $"ValueChanged event fired at {DateTime.Now.ToLongTimeString()}"; } private void OnSignatureBlur() { EventLog = $"OnBlur event fired"; } private void OnSignatureChange(string value) { EventLog = $"OnChange event fired"; } }