@code { private class Foo { public string Text { get; set; } = ""; public int Value { get; set; } public bool Checked { get; set; } } ///
/// ///
private IEnumerable Items1 { get; set; } = new List() { new Foo { Text = "Item 1", Value = 1, Checked = true }, new Foo { Text = "Item 2", Value = 2, Checked = false }, new Foo { Text = "Item 3", Value = 3, Checked = true }, new Foo { Text = "Item 4", Value = 4, Checked = false } }; private string Value1 { get; set; } = "1,3"; private Task OnSelectedChanged(IEnumerable items, Foo foo, string value) { Trace?.Log($"{foo.Text} - {foo.Checked} Value: {foo.Value} 共 {items.Where(i => i.Checked).Count()} 项被选中 组件绑定值 value：{value}"); Trace?.Log($"组件绑定值 Value1：{Value1}"); return Task.CompletedTask; } }