Class TooltipService
- Namespace
- Radzen
- Assembly
- Radzen.Blazor.dll
Class TooltipService. Contains various methods with options to open and close tooltips. Should be added as scoped service in the application services and RadzenTooltip should be added in application main layout. Implements the IDisposable
public class TooltipService : IDisposable
- Inheritance
-
TooltipService
- Implements
- Inherited Members
Examples
@inject TooltipService tooltipService
<RadzenButton Text="Show tooltip" MouseEnter="@(args => ShowTooltipWithHtml(args, new TooltipOptions(){ Style = "color:#000", Duration = null }))" />
@code {
void ShowTooltipWithHtml(ElementReference elementReference, TooltipOptions options = null) => tooltipService.Open(elementReference, ds =>
@<div>
Some<b>HTML</b> content
</div>, options);
}
}
Constructors
TooltipService(NavigationManager)
Initializes a new instance of the TooltipService class.
public TooltipService(NavigationManager uriHelper)
Parameters
uriHelper
NavigationManagerThe URI helper.
- See Also
Methods
Close()
Closes this instance.
public void Close()
- See Also
Dispose()
Disposes this instance.
public void Dispose()
- See Also
Open(ElementReference, RenderFragment<TooltipService>, TooltipOptions)
Opens the specified element.
public void Open(ElementReference element, RenderFragment<TooltipService> childContent, TooltipOptions o = null)
Parameters
element
ElementReferenceThe element.
childContent
RenderFragment<TooltipService>Content of the child.
o
TooltipOptionsThe o.
- See Also
Open(ElementReference, string, TooltipOptions)
Opens the specified element.
public void Open(ElementReference element, string text, TooltipOptions o = null)
Parameters
element
ElementReferenceThe element.
text
stringThe text.
o
TooltipOptionsThe o.
- See Also
OpenOnTheBottom(ElementReference, string, TooltipOptions)
Opens the specified element on the bottom position.
public void OpenOnTheBottom(ElementReference element, string text, TooltipOptions o = null)
Parameters
element
ElementReferenceThe element.
text
stringThe text.
o
TooltipOptionsThe o.
- See Also
OpenOnTheLeft(ElementReference, string, TooltipOptions)
Opens the specified element on the left position.
public void OpenOnTheLeft(ElementReference element, string text, TooltipOptions o = null)
Parameters
element
ElementReferenceThe element.
text
stringThe text.
o
TooltipOptionsThe o.
- See Also
OpenOnTheRight(ElementReference, string, TooltipOptions)
Opens the specified element on the right position.
public void OpenOnTheRight(ElementReference element, string text, TooltipOptions o = null)
Parameters
element
ElementReferenceThe element.
text
stringThe text.
o
TooltipOptionsThe o.
- See Also
OpenOnTheTop(ElementReference, string, TooltipOptions)
Opens the specified element on the top position.
public void OpenOnTheTop(ElementReference element, string text, TooltipOptions o = null)
Parameters
element
ElementReferenceThe element.
text
stringThe text.
o
TooltipOptionsThe o.
- See Also
Events
OnClose
Raises the Close event.
public event Action OnClose
Event Type
- See Also
OnNavigate
Occurs when [on navigate].
public event Action OnNavigate
Event Type
- See Also
OnOpen
Occurs when [on open].
public event Action<ElementReference, Type, TooltipOptions> OnOpen
Event Type
- See Also