Как я мог добиться следующего, это список из многих элементов. в теме
и это мой код:
<Label Text = "Today Appointments :" TextColor = "#2196f3" WidthRequest = "200"
HeightRequest = "50" FontSize = "Small" Margin = "13" FontAttributes = "Bold" ></Label >
<ListView HasUnevenRows = "True" ItemsSource = "{Binding Appoitments}" RowHeight = "5" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid RowDefinitions = "Auto,Auto,Auto">
<Frame
BorderColor = "Gray"
CornerRadius = "5"
Padding = "8"
HasShadow = "True"
>
<StackLayout Orientation = "Vertical" Padding = "5">
<Label Grid.Row = "0" Text = "{Binding AppointmentPatientName}" TextColor = "Black" FontSize = "Small" FontAttributes = "Bold" Margin = "20" />
<Label Grid.Row = "0" Grid.Column = "1" Text = "{Binding AppointmentDate}" TextColor = "Black" FontSize = "Small" FontAttributes = "Bold" Margin = "20" />
</StackLayout>
</Frame>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
CollectionView предлагает возможность сгруппировать ваши элементы в списке и создать заголовок для вашей группы. Включить свойство IsGrouped:
<CollectionView IsGrouped = "true" />
затем добавьте
<CollectionView.GroupHeaderTemplate>
<DataTemplate>
//Your Group Header here...
<Label Text = "{Binding AppoitmentsId}"
BackgroundColor = "LightGray"
FontSize = "Large"
FontAttributes = "Bold" />
</DataTemplate>
</CollectionView.GroupHeaderTemplate>
использовать Группировка