18 lines
584 B
Text
18 lines
584 B
Text
|
@inject State State
|
||
|
|
||
|
<button id="refreshButton" class="absolute transparent circle top right margin" @onclick="() => State.IsRefreshing = true">
|
||
|
<i class="fa-solid fa-arrow-rotate-right @(State.IsRefreshing ? "fa-spin" : "")"></i>
|
||
|
</button>
|
||
|
|
||
|
@code {
|
||
|
protected override async Task OnInitializedAsync() {
|
||
|
await base.OnInitializedAsync();
|
||
|
State.PropertyChanged += StateChanged;
|
||
|
}
|
||
|
|
||
|
private async void StateChanged(object? sender, PropertyChangedEventArgs e) {
|
||
|
if (e.PropertyName == nameof(State.IsRefreshing)) {
|
||
|
await InvokeAsync(StateHasChanged);
|
||
|
}
|
||
|
}
|
||
|
}
|