<ContentPage>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<syncfusion:SfListView x:Name="listView" ItemSize="{Binding Itemsize}" >
<syncfusion:SfListView.ItemTemplate>
<Grid x:Name="grid" Margin="5" BackgroundColor="Red" >
<Image Source="{Binding ContactImage}" Aspect="Fill" />
</Grid>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView>
</Grid>
</ContentPage> |
public double Itemsize
{
get { return size; }
set
{
size = value;
OnPropertyChanged("Itemsize");
}
}
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
int totItems=viewModel.contactsinfo.Count;
viewModel.Itemsize = width / totItems;
} |