You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
820 B
46 lines
820 B
@implements IDisposable; |
|
|
|
@inject ITooltipService TooltipService |
|
|
|
@if (TooltipService.HasTooltips()) |
|
{ |
|
<div class="tooltipsContainer"> |
|
@foreach (var tooltip in Tooltips) |
|
{ |
|
<TooltipComponent Tooltip="tooltip"/> |
|
} |
|
</div> |
|
} |
|
|
|
<style> |
|
.tooltipContainer { |
|
position: fixed; |
|
top: 64px; |
|
right: 64px; |
|
display: flex; |
|
flex-direction: column; |
|
gap: 5px; |
|
} |
|
</style> |
|
|
|
|
|
@code { |
|
private List<TooltipModel> Tooltips => TooltipService.GetTooltips(); |
|
|
|
protected override void OnInitialized() |
|
{ |
|
base.OnInitialized(); |
|
TooltipService.Subscribe(OnUpdate); |
|
} |
|
|
|
void IDisposable.Dispose() |
|
{ |
|
TooltipService.Unsubscribe(OnUpdate); |
|
} |
|
|
|
void OnUpdate() |
|
{ |
|
StateHasChanged(); |
|
} |
|
|
|
} |