View MyGrid.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Parameter] | |
public IEnumerable<object> DataSource {set; get; } | |
private IEnumerable<object> Cache {set; get; } = null; | |
List<MyColumn> Columns = new List<MyColumn>(); | |
public void AddColumn(MyColumn column) | |
{ | |
var seg = DataSource; | |
Cache ??= DataSource.ToList(); | |
DataSource = Cache; |
View index.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page "/" | |
Tics per second: <input type="range" min="1" max="500" @bind="@CurrentValue" class="slider" id="myRange"> @CurrentValue | |
<br/><br/> | |
<div style="width:500px; height:10px; background-color: blue; position: relative;"> | |
<div class="ball" style="@position_txt"></div> | |
</div> | |
<br/><br/> | |
<span>@DateTime.Now.ToString("HH:mm:ss")</span> | |
<span>Number of renders: @nRenders.ToString("N0")</span> | |
<br/><br/> |