Blazor

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ZoomOptions - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ZoomOptions

    Represents the scaling of diagram control by the given factor.

    Inheritance
    System.Object
    ZoomOptions
    Implements
    System.IEquatable<ZoomOptions>
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ZoomOptions : Object, IEquatable<ZoomOptions>
    Examples
    <input type="button" value="Zoom" @onclick="@OnZoom" />
    <input type = "button" value="Zoom To" @onclick="@OnZoomRegion" />
    <SfDiagram @ref = "@Diagram" Height="600px" Nodes="@NodeCollection" Connectors="@ConnectorCollection">
    </SfDiagram>
    @code{
       SfDiagram Diagram;
       public ObservableCollection<DiagramNode> NodeCollection;
       public ObservableCollection<DiagramConnector> ConnectorCollection;
       public ObservableCollection<DiagramLayer> LayersCollection;
       protected override void OnInitialized()
       {
           // A node is created and stored in the node's collection.
           NodeCollection = new ObservableCollection<DiagramNode>(){
               new DiagramNode()
               {
                   Id = "Node1",
                   // Position of the node
                   OffsetX = 250, OffsetY = 250,
                   // Size of the node
                   Width = 100, Height = 100,
                   Style = new NodeShapeStyle() { Fill = "#6BA5D7", StrokeColor = "white" }
               }
           };
           ConnectorCollection = new ObservableCollection<DiagramConnector>()
           {
               new DiagramConnector()
               {
                   Id = "Connector1",
                   SourcePoint = new ConnectorSourcePoint() { X = 300, Y = 100 },
                   TargetPoint = new ConnectorTargetPoint() { X = 400, Y = 200 },
                   Type = Segments.Orthogonal
               }
           };
       }
       // Zoom the diagram
       public void OnZoom()
       {
           Diagram.Zoom(0.5);
       }
       public void OnZoomRegion()
       {
           ZoomOptions Options = new ZoomOptions() { FocusPoint = new PointModel() { X = 100, Y = 100 }, Type = ZoomTypes.ZoomIn, ZoomFactor = 2.5 };
           Diagram.ZoomTo(Options);
       }
    }

    Constructors

    ZoomOptions()

    Declaration
    public ZoomOptions()

    Properties

    FocusPoint

    It allows the user to read the focus value of the diagram.

    Declaration
    public PointModel FocusPoint { get; set; }
    Property Value
    Type Description
    PointModel

    Type

    Defines the zoom type as zoom in or zoom out.

    Declaration
    public ZoomTypes Type { get; set; }
    Property Value
    Type Description
    ZoomTypes

    ZoomFactor

    Sets the factor by which we can zoom in or zoom out.

    Declaration
    public double ZoomFactor { get; set; }
    Property Value
    Type Description
    System.Double

    Methods

    Equals(ZoomOptions)

    Indicates whether the ZoomOptions object is equal to another object of the same type.

    Declaration
    public bool Equals(ZoomOptions zoomOptions)
    Parameters
    Type Name Description
    ZoomOptions zoomOptions

    Represents the scaling of diagram control by the given factor.

    Returns
    Type Description
    System.Boolean

    Returns the scaling of the diagram

    Implements

    System.IEquatable<>
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved