コード例 #1
0
ファイル: TableRow.razor.cs プロジェクト: yorytang/Blazorise
 protected async Task ClickHandler(MouseEventArgs e)
 {
     // https://stackoverflow.com/questions/5497073/how-to-differentiate-single-click-event-and-double-click-event
     // works good enough. Click is still called before the double click, but it is advise to not use both events anyway.
     if (e.Detail == 1)
     {
         await Clicked.InvokeAsync(EventArgsMapper.ToMouseEventArgs(e));
     }
     else if (e.Detail == 2)
     {
         await DoubleClicked.InvokeAsync(EventArgsMapper.ToMouseEventArgs(e));
     }
 }
コード例 #2
0
ファイル: TableRow.razor.cs プロジェクト: weiplanet/Blazorise
 /// <summary>
 /// Handles the row clicked event.
 /// </summary>
 /// <param name="eventArgs">Supplies information about a mouse event that is being raised.</param>
 /// <returns>A task that represents the asynchronous operation.</returns>
 protected Task OnClickHandler(MouseEventArgs eventArgs)
 {
     // https://stackoverflow.com/questions/5497073/how-to-differentiate-single-click-event-and-double-click-event
     // works good enough. Click is still called before the double click, but it is advise to not use both events anyway.
     // We'll be treating any Detail higher then 2 as the user constantly clicking, therefore triggering Single Click.
     if (eventArgs.Detail == 1 || eventArgs.Detail > 2)
     {
         return(Clicked.InvokeAsync(EventArgsMapper.ToMouseEventArgs(eventArgs)));
     }
     else if (eventArgs.Detail == 2)
     {
         return(DoubleClicked.InvokeAsync(EventArgsMapper.ToMouseEventArgs(eventArgs)));
     }
     return(Task.CompletedTask);
 }
コード例 #3
0
 /// <summary>
 /// Handles the header cell clicked event.
 /// </summary>
 /// <param name="eventArgs">Supplies information about a mouse event that is being raised.</param>
 /// <returns>A task that represents the asynchronous operation.</returns>
 protected Task OnClickHandler(MouseEventArgs eventArgs)
 {
     return(Clicked.InvokeAsync(EventArgsMapper.ToMouseEventArgs(eventArgs)));
 }
コード例 #4
0
 protected void HandleClick(MouseEventArgs e)
 {
     Clicked.InvokeAsync(EventArgsMapper.ToMouseEventArgs(e));
 }
コード例 #5
0
 protected Task HandleClick(MouseEventArgs e)
 {
     return(Clicked.InvokeAsync(EventArgsMapper.ToMouseEventArgs(e)));
 }