@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
@foreach (var item in items) {
<button @onclick="@(()=> item.Shown = true)">@item.Src</button>
}
@code {
List<Image> items = Enumerable.Range(1, 10).Select(i => new Image { FileName = i}).ToList();
public class Image
{
public int FileName {get;set;}
public bool Shown {get;set;}
public string Src => Shown ? $"{FileName}.jpg" : "0.jpg";
}
}