Class SfInteractiveViewer
Represents a control that enables users to interact with content through zooming and panning operations. The SfInteractiveViewer control can host any .NET MAUI view and provides an intuitive way to view, navigate, and explore content such as images, graphics, diagrams, and custom controls.
Implements
Namespace: Syncfusion.Maui.Toolkit.InteractiveViewer
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class SfInteractiveViewer : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IInteractiveViewerInfo, IInteractiveZoomInfo, IParentThemeElement, IThemeElement
Constructors
SfInteractiveViewer()
Initializes a new instance of the SfInteractiveViewer class.
Declaration
public SfInteractiveViewer()
Fields
ContentProperty
Identifies the Content bindable property.
Declaration
public static readonly BindableProperty ContentProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for the Content bindable property. |
IsPanEnabledProperty
Identifies the IsPanEnabled bindable property.
Declaration
public static readonly BindableProperty IsPanEnabledProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for the IsPanEnabled bindable property. |
IsZoomEnabledProperty
Identifies the IsZoomEnabled bindable property.
Declaration
public static readonly BindableProperty IsZoomEnabledProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for the IsZoomEnabled bindable property. |
MaximumZoomFactorProperty
Identifies the MaximumZoomFactor bindable property.
Declaration
public static readonly BindableProperty MaximumZoomFactorProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for the MaximumZoomFactor bindable property. |
MinimumZoomFactorProperty
Identifies the MinimumZoomFactor bindable property.
Declaration
public static readonly BindableProperty MinimumZoomFactorProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for the MinimumZoomFactor bindable property. |
PanAxisProperty
Identifies the PanAxis bindable property.
Declaration
public static readonly BindableProperty PanAxisProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for the PanAxis bindable property. |
ZoomFactorProperty
Identifies the ZoomFactor bindable property.
Declaration
public static readonly BindableProperty ZoomFactorProperty
Field Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for the ZoomFactor bindable property. |
Properties
Content
Gets or sets the content displayed in the SfInteractiveViewer.
Declaration
public View Content { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Controls.View | The default value of Content is null. |
See Also
IsPanEnabled
Gets or sets a value indicating whether panning is enabled in the SfInteractiveViewer.
Declaration
public bool IsPanEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value of IsPanEnabled is true. |
See Also
IsZoomEnabled
Gets or sets a value indicating whether zooming is enabled in the SfInteractiveViewer.
Declaration
public bool IsZoomEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | The default value of IsZoomEnabled is true. |
See Also
MaximumZoomFactor
Gets or sets the maximum zoom factor allowed in the SfInteractiveViewer.
Declaration
public double MaximumZoomFactor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The default value of MaximumZoomFactor is 10d. |
Remarks
This property is applicable only when IsZoomEnabled is set to true.
See Also
MinimumZoomFactor
Gets or sets the minimum zoom factor allowed in the SfInteractiveViewer.
Declaration
public double MinimumZoomFactor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The default value of MinimumZoomFactor is 1d. |
Remarks
This property is applicable only when IsZoomEnabled is set to true.
See Also
PanAxis
Gets or sets the axis in which panning is allowed in the SfInteractiveViewer.
Declaration
public PanAxis PanAxis { get; set; }
Property Value
| Type | Description |
|---|---|
| PanAxis |
Remarks
This property is applicable only when IsPanEnabled is set to true.
ZoomFactor
Gets or sets the current zoom factor of the SfInteractiveViewer.
Declaration
public double ZoomFactor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The default value of ZoomFactor is 1d. |
Remarks
This property is applicable only when IsZoomEnabled is set to true.
See Also
Methods
OnHandlerChanged()
Declaration
protected override void OnHandlerChanged()
Overrides
Reset()
Method to reset the interactive viewer to its default state.
Declaration
public void Reset()
Remarks
Resets the content's zoom level, rotation, and pan position to their original values.
Rotate()
Method to rotate the content clockwise by 90 degrees.
Declaration
public void Rotate()
Remarks
This method applies a 90-degree clockwise rotation to the content displayed in the SfInteractiveViewer. Consecutive calls continue rotating the content in 90-degree increments.
Events
ScrollChanged
Occurs when the pan position or zoom factor of the interactive viewer changes.
Declaration
public event EventHandler<InteractiveScrollChangedEventArgs> ScrollChanged
Event Type
| Type |
|---|
| System.EventHandler<InteractiveScrollChangedEventArgs> |
ZoomFactorChanged
Occurs when the zoom factor of the interactive viewer changes.
Declaration
public event EventHandler<ZoomFactorChangedEventArgs> ZoomFactorChanged
Event Type
| Type |
|---|
| System.EventHandler<ZoomFactorChangedEventArgs> |