Example #1
0
 /// <summary>
 /// Scroll to an url fragment
 /// </summary>
 /// <param name="id">The id of the selector that is going to be scrolled to</param>
 /// <param name="behavior">smooth or auto</param>
 /// <returns></returns>
 public async Task ScrollToFragment(string id, ScrollBehavior behavior)
 {
     await _jSRuntime
     .InvokeVoidAsync("scrollHelpers.scrollToFragment",
                      id,
                      behavior.ToDescriptionString());
 }
Example #2
0
 /// <summary>
 /// Scrolls to the coordinates of the element defined in Selector property
 /// </summary>
 /// <param name="left">x coordinate</param>
 /// <param name="top">y coordinate</param>
 /// <param name="behavior">smooth or auto</param>
 /// <returns></returns>
 public async Task ScrollTo(int left = 0, int top = 0, ScrollBehavior behavior = ScrollBehavior.Auto)
 {
     await _jSRuntime
     .InvokeVoidAsync("scrollHelpers.scrollTo",
                      Selector,
                      left,
                      top,
                      behavior.ToDescriptionString());
 }
Example #3
0
 /// <summary>
 /// Scrolls to the coordinates of the element
 /// </summary>
 /// <param name="id">id of element</param>
 /// <param name="left">x coordinate</param>
 /// <param name="top">y coordinate</param>
 /// <param name="behavior">smooth or auto</param>
 /// <returns></returns>
 public ValueTask ScrollToAsync(string id, int left, int top, ScrollBehavior behavior) =>
 _jSRuntime.InvokeVoidAsync("mudScrollManager.scrollTo", id, left, top, behavior.ToDescriptionString());
Example #4
0
 /// <summary>
 /// Scroll to an url fragment
 /// </summary>
 /// <param name="id">The id of the selector that is going to be scrolled to</param>
 /// <param name="behavior">smooth or auto</param>
 /// <returns></returns>
 public ValueTask ScrollToFragmentAsync(string id, ScrollBehavior behavior) =>
 _jSRuntime.InvokeVoidAsync("mudScrollManager.scrollToFragment", id, behavior.ToDescriptionString());