|
<syncfusion:SfListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid Padding="2" Margin="2">
<Frame Padding="2" Margin="2" OutlineColor="AntiqueWhite" HasShadow="True">
<StackLayout BackgroundColor="{Binding Path=BindingContext.Color,Source={x:Reference listView}}">
<Label x:Name="label" Text="{Binding Key}"
FontSize="22"
FontAttributes="Bold"
VerticalOptions="Center"
HorizontalOptions="Start"
/>
</StackLayout>
</Frame>
</Grid>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</syncfusion:SfListView.GroupHeaderTemplate> |
|
<syncfusion:SfListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid Padding="2" Margin="2">
<Frame Padding="2" Margin="2" OutlineColor="AntiqueWhite" HasShadow="True">
. . . . . . .
. . . . . . .
</Frame>
</Grid>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</syncfusion:SfListView.GroupHeaderTemplate> |
|
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Frame Padding="1,0,1,0" OutlineColor="Black" BackgroundColor="{Binding Converter={StaticResource colorConverter}}">
<Label x:Name="label" Text="{Binding Key}"
FontSize="22"
FontAttributes="Bold"
VerticalOptions="Center"
HorizontalOptions="Start"
/>
</Frame>
</ViewCell.View>
</ViewCell>
</DataTemplate> |
|
public class ColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var groupResult = value as GroupResult;
if (groupResult == null)
return value;
if (groupResult.Count % 2 == 0)
return Color.AliceBlue;
else
return Color.Green;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
}
} |