🐥note.

小鳥とMicrosoft <3 なエンジニアの技術Blog📚

Blazor Event名の一覧

Blazorで使用できるEventを列挙しました。
いずれもon{Event名}で使えるはずです。

Focus events

Event 名 Args
onfocus FocusEventArgs
onblur FocusEventArgs
onfocusin FocusEventArgs
onfocusout FocusEventArgs

Mouse events

Event 名 Args
onmouseover MouseEventArgs
onmouseout MouseEventArgs
onmousemove MouseEventArgs
onmousedown MouseEventArgs
onmouseup MouseEventArgs
onclick MouseEventArgs
ondblclick MouseEventArgs
onwheel WheelEventArgs
onmousewheel WheelEventArgs
oncontextmenu MouseEventArgs

Drag events

Event 名 Args
ondrag DragEventArgs
ondragend DragEventArgs
ondragenter DragEventArgs
ondragleave DragEventArgs
ondragover DragEventArgs
ondragstart DragEventArgs
ondrop DragEventArgs

Keyboard events

Event 名 Args
onkeydown KeyboardEventArgs
onkeyup KeyboardEventArgs
onkeypress KeyboardEventArgs

Input events

Event 名 Args
onchange ChangeEventArgs
oninput ChangeEventArgs
oninvalid EventArgs
onreset EventArgs
onselect EventArgs
onselectstart EventArgs
onselectionchange EventArgs
onsubmit EventArgs

Clipboard events

Event 名 Args
onbeforecopy EventArgs
onbeforecut EventArgs
onbeforepaste EventArgs
oncopy ClipboardEventArgs
oncut ClipboardEventArgs
onpaste ClipboardEventArgs

Touch events

Event 名 Args
ontouchcancel TouchEventArgs
ontouchend TouchEventArgs
ontouchmove TouchEventArgs
ontouchstart TouchEventArgs
ontouchenter TouchEventArgs
ontouchleave TouchEventArgs

Pointer events

Event 名 Args
ongotpointercapture PointerEventArgs
onlostpointercapture PointerEventArgs
onpointercancel PointerEventArgs
onpointerdown PointerEventArgs
onpointerenter PointerEventArgs
onpointerleave PointerEventArgs
onpointermove PointerEventArgs
onpointerout PointerEventArgs
onpointerover PointerEventArgs
onpointerup PointerEventArgs

Media events

Event 名 Args
oncanplay EventArgs
oncanplaythrough EventArgs
oncuechange EventArgs
ondurationchange EventArgs
onemptied EventArgs
onpause EventArgs
onplay EventArgs
onplaying EventArgs
onratechange EventArgs
onseeked EventArgs
onseeking EventArgs
onstalled EventArgs
onstop EventArgs
onsuspend EventArgs
ontimeupdate EventArgs
onvolumechange EventArgs
onwaiting EventArgs

Progress events

Event 名 Args
onloadstart ProgressEventArgs
ontimeout ProgressEventArgs
onabort ProgressEventArgs
onload ProgressEventArgs
onloadend ProgressEventArgs
onprogress ProgressEventArgs
onerror ErrorEventArgs

General events

Event 名 Args
onactivate EventArgs
onbeforeactivate EventArgs
onbeforedeactivate EventArgs
ondeactivate EventArgs
onended EventArgs
onfullscreenchange EventArgs
onfullscreenerror EventArgs
onloadeddata EventArgs
onloadedmetadata EventArgs
onpointerlockchange EventArgs
onpointerlockerror EventArgs
onreadystatechange EventArgs
onscroll EventArgs

<div @onmouseover="OnMouseover">
    <button @onclick="OnClicked">
</div>

@code {
    void OnMouseover() {
        Console.WriteLine("Mouseover!");
    }

    void OnClicked() {
        Console.WriteLine("Clicked!");
    }
}

参考

github.com