|
3 | 3 | // See the LICENSE file in the project root for more information. |
4 | 4 | // Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone |
5 | 5 |
|
| 6 | +using DocumentFormat.OpenXml.Office2010.Excel; |
| 7 | +using DocumentFormat.OpenXml.Wordprocessing; |
| 8 | + |
6 | 9 | namespace BootstrapBlazor.Server.Components.Samples; |
7 | 10 |
|
8 | 11 | /// <summary> |
@@ -52,6 +55,12 @@ private Task OnSelectedChanged(IEnumerable<SelectedItem> values, string val) |
52 | 55 | return Task.CompletedTask; |
53 | 56 | } |
54 | 57 |
|
| 58 | + [NotNull] |
| 59 | + private IEnumerable<SelectedItem<Foo>>? GenericItems { get; set; } |
| 60 | + |
| 61 | + [NotNull] |
| 62 | + private Foo? _selectedFoo = default; |
| 63 | + |
55 | 64 | /// <summary> |
56 | 65 | /// OnInitialized 方法 |
57 | 66 | /// </summary> |
@@ -85,6 +94,15 @@ protected override void OnInitialized() |
85 | 94 |
|
86 | 95 | Model = Foo.Generate(LocalizerFoo); |
87 | 96 | FooItems = Foo.GetCompleteItems(LocalizerFoo); |
| 97 | + |
| 98 | + GenericItems = new List<SelectedItem<Foo>>() |
| 99 | + { |
| 100 | + new() { Text = Localizer["item1"], Value = new Foo() { Id = 1, Name = LocalizerFoo["Foo.Name", "001"] } }, |
| 101 | + new() { Text = Localizer["item2"], Value = new Foo() { Id = 2, Name = LocalizerFoo["Foo.Name", "002"] } }, |
| 102 | + new() { Text = Localizer["item3"], Value = new Foo() { Id = 3, Name = LocalizerFoo["Foo.Name", "003"] } }, |
| 103 | + }; |
| 104 | + |
| 105 | + _selectedFoo = new Foo() { Id = 1, Name = LocalizerFoo["Foo.Name", "001"] }; |
88 | 106 | } |
89 | 107 |
|
90 | 108 | private Task OnItemChanged(IEnumerable<SelectedItem> values, SelectedItem val) |
|
0 commit comments