Class ZoomSlider
This class implements a zoom slider for GoDiagram diagrams.
Namespace: Northwoods.Go.Extensions
Assembly: ZoomSliderWinForms.dll
Syntax
public class ZoomSlider
Remarks
The constructor has the following arguments:
diagram
Diagram a reference to a GoDiagram diagram
Unlike the GoJS version, this version of the ZoomSlider extension only provides an interface between a "range" input and the zoom state of a connected Diagram. As such, all properties such as size, button size, alignment, etc should be handled separately and are not passed as parameters to this Extension.
The Extension takes as parameters two delegates, which should respectively get and set the value parameter of the Range component. An example of this implementation can be found in the ZoomSlider sample.
Constructors
ZoomSlider(Diagram, Func<double>, Action<double>)
Constructs a ZoomSlider and sets up properties based on the options provided. Also sets up change listeners on the Diagram so the ZoomSlider stays up to date.
Declaration
public ZoomSlider(Diagram diagram, Func<double> get, Action<double> set)
Parameters
Type | Name | Description |
---|---|---|
Diagram | diagram | |
Func<double> | get | |
Action<double> | set |
Properties
Diagram
This read-only property returns the diagram for which the slider is handling zoom.
Declaration
public Diagram Diagram { get; }
Property Value
Type | Description |
---|---|
Diagram |
Methods
UpdateScale()
Modify the Diagram.Scale according to the value of the ZoomSlider.
This function should be called when the value of the ZoomSlider changes.
Declaration
public void UpdateScale()