using System.Collections.Generic; using System.Threading.Tasks; namespace DotvvmApplication1.ViewModels; public class DefaultViewModel : MasterPageViewModel { public List Products { get; set; } public List Categories1 { get; set; } public List Categories2 { get; set; } public DefaultViewModel() { } public override async Task Load() { if (!Context.IsPostBack) { Categories1 = [ new() { Id = 1, Name = "C1-1" }, new() { Id = 2, Name = "C1-2" }, new() { Id = 3, Name = "C1-3" } ]; Categories2 = [ new() { Id = 10, Name = "C2-10" }, new() { Id = 11, Name = "C2-11" }, new() { Id = 12, Name = "C2-12" } ]; Products = [ new() { Name = "Product 1", Category1 = 1, Category2 = 10, Colors = ["Red"] }, new() { Name = "Product 2", Category1 = 2, Category2 = 11, Colors = ["Green", "Yellow"] }, new() { Name = "Product 3", Category1 = 3, Category2 = 12, Colors = ["Orange"] } ]; } await base.Load(); } }