UI_SequentMicrosystems-RPI/Pages/Counter.razor

35 lines
616 B
Plaintext
Raw Normal View History

2023-12-16 07:59:53 +00:00
@page "/counter"
@using UI_SequentMicrosystems.Services
@inject NavigationManager Navigator
@inject RTD8TMService _RTD8TMService
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<h2>@Navigator.BaseUri --> @address</h2>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
private string address = "";
protected override void OnInitialized()
{
_RTD8TMService.SetAddress(Navigator.BaseUri);
}
}