Hello,
i need to group lists in a collectionview then to send the sum of all fields (Individual_Note) of the nested List into a field (Total_Note) in the CollectionView.GroupHeader.
This, every time the the value of Individual_Note changed.
Thanks for your advices.
i need to group lists in a collectionview then to send the sum of all fields (Individual_Note) of the nested List into a field (Total_Note) in the CollectionView.GroupHeader.
This, every time the the value of Individual_Note changed.
Thanks for your advices.
C#:
<CollectionView x:Name="cv1" ItemsSource="{Binding MainList}" IsGrouped="True">
<CollectionView.GroupHeaderTemplate >
<DataTemplate x:DataType="model:NestedList" >
<HorizontalStackLayout Spacing="15" HorizontalOptions="Center" Padding="5" BackgroundColor="LightGray">
<Label Text="{Binding Name}" BackgroundColor="LightGray" FontSize="18" FontAttributes="Bold" />
<alohakit:Rating IsReadOnly="True" Value="{Binding Total_Note, Mode=TwoWay}" Grid.Row="1" BackgroundColor="Green" UnSelectedFill="Beige" SelectedFill="ForestGreen" SelectedStroke="Azure" />
</HorizontalStackLayout>
</DataTemplate>
</CollectionView.GroupHeaderTemplate>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="model:UserShort">
<Frame CornerRadius="15" Padding="10" Margin="0,2,0,2" BackgroundColor="White">
<Grid ColumnSpacing="1" RowSpacing="5" ColumnDefinitions="Auto, *" RowDefinitions="*,*">
<Grid RowSpacing="2" RowDefinitions="Auto,Auto" >
<toolkit:AvatarView ImageSource="{Binding Photo}" HorizontalOptions="Start"/>
<Label Text="{Binding Alias}" Grid.Row="1" HorizontalOptions="Center" FontFamily="Metropolis Regular" FontSize="12" />
</Grid>
<Grid Grid.Column="1" Grid.RowSpan="2" HorizontalOptions="Center" VerticalOptions="Center" >
<alohakit:Rating Value="{Binding Individual_Note, Mode=TwoWay}" Grid.Row="1" HorizontalOptions="End" BackgroundColor="Green" UnSelectedFill="Beige" SelectedFill="ForestGreen" SelectedStroke="Azure"/>
</Grid>
</Grid>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>