Xamarin embeddable image viewer with 360 degree support
Note: For now we only support iOS and there is no plan to support Android for the moment. However, we would be happy to review any PRs regarding this feature.
In your iOS project call:
SwankImplementation.Init();
First add the xmlns namespace:
xmlns:swankPlugin="clr-namespace:Swank.FormsPlugin;assembly=Swank.FormsPlugin"
Then add the xaml:
<!-- ViewerImages = IEnumerable<ViewerImage> -->
<swankPlugin:Gallery ItemsSource="{Binding ViewerImages}" />
PositionSelected
: You can attach an event handler that will be fired with the current carousel position.
<swankPlugin:Gallery PositionSelected="Carousel_OnPositionSelected" />
private void Carousel_OnPositionSelected(object sender, PositionSelectedEventArgs e)
{
Console.WriteLine($"Index is {e.NewValue}")
}