11using System . Collections . ObjectModel ;
2+ using Microsoft . Maui . Controls . Shapes ;
23
34namespace Maui . Controls . Sample . Issues ;
45
@@ -38,7 +39,7 @@ public Issue12008()
3839 ItemsSource = Groups ,
3940 IsGrouped = true ,
4041 CanReorderItems = true ,
41- CanMixGroups = true ,
42+ CanMixGroups = true ,
4243 SelectionMode = SelectionMode . None
4344 } ;
4445
@@ -59,7 +60,7 @@ public Issue12008()
5960 TextColor = Colors . Gray ,
6061 HorizontalTextAlignment = TextAlignment . End
6162 } ;
62- countLabel . SetBinding ( Label . TextProperty , new Binding ( "Items. Count" , stringFormat : "({0} items)" ) ) ;
63+ countLabel . SetBinding ( Label . TextProperty , new Binding ( "Count" , stringFormat : "({0} items)" ) ) ;
6364
6465 var headerGrid = new Grid
6566 {
@@ -73,7 +74,7 @@ public Issue12008()
7374 }
7475 } ;
7576 headerGrid . SetColumn ( countLabel , 1 ) ;
76-
77+
7778 // Set AutomationId based on group name
7879 headerGrid . SetBinding ( AutomationProperties . NameProperty , new Binding ( "Name" ) ) ;
7980
@@ -90,16 +91,16 @@ public Issue12008()
9091 } ;
9192 itemLabel . SetBinding ( Label . TextProperty , "Name" ) ;
9293
93- var itemContainer = new Frame
94+ var itemContainer = new Border
9495 {
9596 Padding = 0 ,
9697 Margin = new Thickness ( 12 , 4 , 12 , 4 ) ,
9798 Content = itemLabel ,
9899 BackgroundColor = Colors . White ,
99- CornerRadius = 5 ,
100- HasShadow = true
100+ StrokeShape = new RoundRectangle { CornerRadius = 5 } ,
101+ Shadow = new Shadow { Opacity = 0.3f , Radius = 2 }
101102 } ;
102-
103+
103104 // Set AutomationId based on item name for testability
104105 itemContainer . SetBinding ( AutomationProperties . NameProperty , new Binding ( "Name" ) ) ;
105106
@@ -134,31 +135,22 @@ public Issue12008()
134135
135136 void OnReorderCompleted ( object sender , EventArgs e )
136137 {
137- // Update status label when reorder completes
138+ // Update status label with per-group counts so tests can verify actual data model changes
138139 if ( Content is VerticalStackLayout layout && layout . Children [ 0 ] is Label statusLabel )
139140 {
140- statusLabel . Text = "Reorder completed!" ;
141+ var groupCounts = string . Join ( ", " , Groups . Select ( g => $ "{ g . Name } :{ g . Count } ") ) ;
142+ statusLabel . Text = $ "Reorder completed! { groupCounts } ";
141143 statusLabel . BackgroundColor = Color . FromArgb ( "#C8E6C9" ) ;
142-
143- // Reset status after 2 seconds
144- MainThread . BeginInvokeOnMainThread ( async ( ) =>
145- {
146- await Task . Delay ( 2000 ) ;
147- statusLabel . Text = "Ready to reorder items" ;
148- statusLabel . BackgroundColor = Color . FromArgb ( "#E8F5E9" ) ;
149- } ) ;
150144 }
151145 }
152146
153147 public class Issue12008Group : ObservableCollection < Item >
154148 {
155149 public string Name { get ; set ; }
156- public new ObservableCollection < Item > Items { get ; }
157150
158151 public Issue12008Group ( string name , ObservableCollection < Item > items )
159152 {
160153 Name = name ;
161- Items = items ;
162154
163155 foreach ( var item in items )
164156 Add ( item ) ;
0 commit comments