Class TooltipService
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
Implements
Inherited Members
Namespace: Radzen
Assembly: Radzen.Blazor.dll
Syntax
public class TooltipService : IDisposable
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.
Declaration
public TooltipService(NavigationManager uriHelper)
Parameters
Type | Name | Description |
---|---|---|
NavigationManager | uriHelper | The URI helper. |
See Also
Methods
Close()
Closes this instance.
Declaration
public void Close()
See Also
Dispose()
Disposes this instance.
Declaration
public void Dispose()
See Also
Open(ElementReference, RenderFragment<TooltipService>, TooltipOptions)
Opens the specified element.
Declaration
public void Open(ElementReference element, RenderFragment<TooltipService> childContent, TooltipOptions o = null)
Parameters
Type | Name | Description |
---|---|---|
ElementReference | element | The element. |
RenderFragment<TooltipService> | childContent | Content of the child. |
TooltipOptions | o | The o. |
See Also
Open(ElementReference, string, TooltipOptions)
Opens the specified element.
Declaration
public void Open(ElementReference element, string text, TooltipOptions o = null)
Parameters
Type | Name | Description |
---|---|---|
ElementReference | element | The element. |
string | text | The text. |
TooltipOptions | o | The o. |
See Also
OpenOnTheBottom(ElementReference, string, TooltipOptions)
Opens the specified element on the bottom position.
Declaration
public void OpenOnTheBottom(ElementReference element, string text, TooltipOptions o = null)
Parameters
Type | Name | Description |
---|---|---|
ElementReference | element | The element. |
string | text | The text. |
TooltipOptions | o | The o. |
See Also
OpenOnTheLeft(ElementReference, string, TooltipOptions)
Opens the specified element on the left position.
Declaration
public void OpenOnTheLeft(ElementReference element, string text, TooltipOptions o = null)
Parameters
Type | Name | Description |
---|---|---|
ElementReference | element | The element. |
string | text | The text. |
TooltipOptions | o | The o. |
See Also
OpenOnTheRight(ElementReference, string, TooltipOptions)
Opens the specified element on the right position.
Declaration
public void OpenOnTheRight(ElementReference element, string text, TooltipOptions o = null)
Parameters
Type | Name | Description |
---|---|---|
ElementReference | element | The element. |
string | text | The text. |
TooltipOptions | o | The o. |
See Also
OpenOnTheTop(ElementReference, string, TooltipOptions)
Opens the specified element on the top position.
Declaration
public void OpenOnTheTop(ElementReference element, string text, TooltipOptions o = null)
Parameters
Type | Name | Description |
---|---|---|
ElementReference | element | The element. |
string | text | The text. |
TooltipOptions | o | The o. |
See Also
Events
OnClose
Raises the Close event.
Declaration
public event Action OnClose
Event Type
Type | Description |
---|---|
Action |
See Also
OnNavigate
Occurs when [on navigate].
Declaration
public event Action OnNavigate
Event Type
Type | Description |
---|---|
Action |
See Also
OnOpen
Occurs when [on open].
Declaration
public event Action<ElementReference, Type, TooltipOptions> OnOpen
Event Type
Type | Description |
---|---|
Action<ElementReference, Type, TooltipOptions> |