<Grid BackgroundColor="LightGray">
<syncfusion:SfRotator DotPlacement="None" Grid.Row="0" x:Name="rotator" VerticalOptions="Center" BackgroundColor="LightGray" Margin="20,0"
WidthRequest="330" HeightRequest="500">
…
</syncfusion:SfRotator> <sfborder:SfBorder BackgroundColor="#FFF200" Padding="5" VerticalOptions="Center" HorizontalOptions="Start" CornerRadius="25">
<sfborder:SfBorder.Content>
<ImageButton x:Name="LeftSwipe" Clicked="LeftSwipe_Clicked" Source="LeftArrow.png" HeightRequest="40" WidthRequest="40" VerticalOptions="Center" HorizontalOptions="Center" >
</ImageButton>
</sfborder:SfBorder.Content>
</sfborder:SfBorder>
<sfborder:SfBorder BackgroundColor="#FFF200" Padding="5" VerticalOptions="Center" HorizontalOptions="End" CornerRadius="25">
<sfborder:SfBorder.Content>
<ImageButton x:Name="RightSwipe" Clicked="RightSwipe_Clicked" Source="RightArrow.png" HeightRequest="40" WidthRequest="40" VerticalOptions="Center" HorizontalOptions="Center" >
</ImageButton>
</sfborder:SfBorder.Content>
</sfborder:SfBorder>
</Grid> |
private void LeftSwipe_Clicked(object sender, EventArgs e)
{
if (rotator.SelectedIndex > 0)
{
rotator.SelectedIndex--;
}
}
private void RightSwipe_Clicked(object sender, EventArgs e)
{
var item = (rotator.DataSource as List<SfRotatorItem>).Count - 1;
if (rotator.SelectedIndex != item)
rotator.SelectedIndex++;
} |