@@ -62,13 +62,24 @@ public partial class MultiSelects
6262
6363 private string SelectedItemsValue { get ; set ; } = "Beijing" ;
6464
65- private IEnumerable < string > SelectedArrayValues { get ; set ; } = Enumerable . Empty < string > ( ) ;
65+ private IEnumerable < string > SelectedArrayValues { get ; set ; } = [ ] ;
6666
6767 private IEnumerable < EnumEducation > SelectedEnumValues { get ; set ; } = new List < EnumEducation >
6868 {
6969 EnumEducation . Middle , EnumEducation . Primary
7070 } ;
7171
72+ private MultiSelectEnumFoo EnumFoo { get ; set ; } = MultiSelectEnumFoo . One | MultiSelectEnumFoo . Two ;
73+
74+ [ Flags ]
75+ private enum MultiSelectEnumFoo
76+ {
77+ One = 1 ,
78+ Two = 2 ,
79+ Three = 4 ,
80+ Four = 8
81+ }
82+
7283 [ NotNull ]
7384 private ConsoleLogger ? Logger { get ; set ; }
7485
@@ -101,7 +112,7 @@ private async Task<SelectedItem> OnEditCallback(string value)
101112 {
102113 await Task . Delay ( 100 ) ;
103114
104- var item = EditableItems . Find ( i => i . Text . Equals ( value , System . StringComparison . OrdinalIgnoreCase ) ) ;
115+ var item = EditableItems . Find ( i => i . Text . Equals ( value , StringComparison . OrdinalIgnoreCase ) ) ;
105116 if ( item == null )
106117 {
107118 item = new SelectedItem ( value , value ) ;
@@ -120,7 +131,7 @@ private async Task<SelectedItem> OnEditCallback(string value)
120131 new ( "Ningbo" , "宁波" ) { GroupName = "华东" , Active = true }
121132 ] ;
122133
123- private readonly SelectedItem [ ] CascadingItems2 =
134+ private readonly SelectedItem [ ] _cascadingItems2 =
124135 [
125136 new ( "" , "请选择 ..." ) ,
126137 new ( "Beijing" , "北京" ) { Active = true } ,
@@ -209,12 +220,12 @@ private void AddListItems()
209220
210221 private void RemoveListItems ( )
211222 {
212- SelectedArrayValues = new [ ] { "Beijing" } ;
223+ SelectedArrayValues = [ "Beijing" ] ;
213224 }
214225
215226 private void ClearListItems ( )
216227 {
217- SelectedArrayValues = Enumerable . Empty < string > ( ) ;
228+ SelectedArrayValues = [ ] ;
218229 }
219230
220231 private void AddArrayItems ( )
@@ -236,7 +247,7 @@ private IEnumerable<SelectedItem> OnSearch(string searchText)
236247 {
237248 Logger . Log ( $ "{ Localizer [ "MultiSelectSearchLog" ] } :{ searchText } ") ;
238249 SearchItemsSource ??= GenerateItems ( ) ;
239- return SearchItemsSource . Where ( i => i . Text . Contains ( searchText , System . StringComparison . OrdinalIgnoreCase ) ) ;
250+ return SearchItemsSource . Where ( i => i . Text . Contains ( searchText , StringComparison . OrdinalIgnoreCase ) ) ;
240251 }
241252
242253 private Task OnSelectedItemsChanged8 ( IEnumerable < SelectedItem > items )
0 commit comments