Skip to content

ImageViewer

A full-screen image overlay with pinch-to-zoom, pan when zoomed, double-tap to toggle zoom, animated open/close transitions, and a close button.

  • NuGet downloads for Shiny.Maui.Controls
GalleryViewer
GalleryViewer
<Grid>
<!-- Page content with tappable images -->
<ScrollView>
<VerticalStackLayout>
<Image Source="photo.png">
<Image.GestureRecognizers>
<TapGestureRecognizer Command="{Binding OpenViewerCommand}"
CommandParameter="photo.png" />
</Image.GestureRecognizers>
</Image>
</VerticalStackLayout>
</ScrollView>
<!-- ImageViewer overlays on top -->
<shiny:ImageViewer Source="{Binding SelectedImage}"
IsOpen="{Binding IsViewerOpen}" />
</Grid>
PropertyTypeDefaultDescription
SourceImageSource?nullThe image to display
IsOpenboolfalseShow/hide the viewer (TwoWay bindable)
MaxZoomdouble5.0Maximum pinch zoom scale
  • Pinch-to-zoom — Two-finger pinch scales around the pinch origin, clamped between 1x and MaxZoom
  • Pan when zoomed — One-finger pan enabled after zooming in, translation clamped to image bounds
  • Double-tap to zoom — Double-tap zooms to 2.5x centered on the tap point; double-tap again resets
  • Animated open/close — Backdrop, image, and close button fade together (250ms)
  • Close button — ”✕” button in the top-right corner
  • Backdrop — Black overlay that swallows touches so nothing passes through to the page behind
public partial class ImageViewerViewModel : ObservableObject
{
[ObservableProperty] ImageSource? selectedImage;
[ObservableProperty] bool isViewerOpen;
[RelayCommand]
void OpenViewer(string imageSource)
{
SelectedImage = imageSource;
IsViewerOpen = true;
}
}
claude plugin marketplace add shinyorg/skills
claude plugin install shiny-maui@shiny

Coming soon — Copilot plugin install instructions will be added here.

View shiny-maui Plugin