initial
This commit is contained in:
commit
7b9d778eb3
29 changed files with 4876 additions and 0 deletions
26
Pages/Counter.razor
Normal file
26
Pages/Counter.razor
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
@page "/counter"
|
||||
|
||||
<PageTitle>Counter</PageTitle>
|
||||
|
||||
<h2>Counter</h2>
|
||||
|
||||
<p role="status">Current count: @_currentCount</p>
|
||||
|
||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me (+@_increment)</button>
|
||||
|
||||
@code {
|
||||
private const int MinIncrement = 1;
|
||||
private const int MaxIncrement = 10;
|
||||
private int _increment = MinIncrement;
|
||||
private int _currentCount;
|
||||
|
||||
private void IncrementCount()
|
||||
{
|
||||
_currentCount += _increment++;
|
||||
|
||||
if(_increment >= MaxIncrement)
|
||||
{
|
||||
_increment = MinIncrement;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue