11 KiB
Minimap Class
Namespace: Nodify
Assembly: Nodify
Inheritance: Object → DispatcherObject → DependencyObject → Visual → UIElement → FrameworkElement → Control → ItemsControl → Minimap
References: InputProcessor, MinimapState.KeyboardNavigation, MinimapItem, NodifyEditor, MinimapState.Panning, ZoomEventArgs, ZoomEventHandler, MinimapState.Zooming
A minimap control that can position the viewport, and zoom in and out.
public class Minimap : ItemsControl
Constructors
Minimap()
public Minimap();
Properties
AllowPanningCancellation
Gets or sets whether panning cancellation is allowed (see Nodify.Interactivity.EditorGestures.MinimapGestures.CancelAction).
public static bool AllowPanningCancellation { get; set; }
Property Value
Extent
The area covered by the items and the viewport rectangle in graph space.
public Rect Extent { get; set; }
Property Value
InputProcessor
protected InputProcessor InputProcessor { get; set; }
Property Value
IsPanning
Whether the user is currently panning the minimap.
protected bool IsPanning { get; set; }
Property Value
IsReadOnly
Whether the minimap can move and zoom the viewport.
public bool IsReadOnly { get; set; }
Property Value
ItemsExtent
The area covered by the MinimapItems in graph space.
public Rect ItemsExtent { get; set; }
Property Value
ItemsHost
Gets the panel that holds all the MinimapItems.
protected Panel ItemsHost { get; set; }
Property Value
MaxViewportOffset
The max position from the NodifyEditor.ItemsExtent that the viewport can move to.
public Size MaxViewportOffset { get; set; }
Property Value
MouseLocation
Gets the current mouse location in graph space coordinates (relative to the Minimap.ItemsHost).
public Point MouseLocation { get; set; }
Property Value
NavigationStepSize
Defines the distance to pan when using directional input (such as arrow keys).
public static double NavigationStepSize { get; set; }
Property Value
ResizeToViewport
Whether the minimap should resize to also display the whole viewport.
public bool ResizeToViewport { get; set; }
Property Value
ViewportLocation
public Point ViewportLocation { get; set; }
Property Value
ViewportSize
public Size ViewportSize { get; set; }
Property Value
ViewportStyle
Gets or sets the style to use for the viewport rectangle.
public Style ViewportStyle { get; set; }
Property Value
Methods
BeginPanning()
Starts the panning operation from the specified location. Call Nodify.Minimap.EndPanning to end the panning operation.
public void BeginPanning();
BeginPanning(Point)
public void BeginPanning(Point location);
Parameters
location Point
CancelPanning()
Cancels the current panning operation and reverts the viewport to its initial location if Minimap.AllowPanningCancellation is true. Otherwise, it ends the panning operation by calling Nodify.Minimap.EndPanning.
public void CancelPanning();
EndPanning()
Ends the current panning operation, retaining the current Minimap.ViewportLocation.
public void EndPanning();
GetContainerForItemOverride()
protected override DependencyObject GetContainerForItemOverride();
Returns
GetLocationInsideMinimap(MouseEventArgs)
Translates the event location to graph space coordinates (relative to the Minimap.ItemsHost).
public Point GetLocationInsideMinimap(MouseEventArgs args);
Parameters
args MouseEventArgs: The mouse event.
Returns
Point: A location inside the minimap
IsItemItsOwnContainerOverride(Object)
protected override bool IsItemItsOwnContainerOverride(object item);
Parameters
item Object
Returns
OnApplyTemplate()
public override void OnApplyTemplate();
OnKeyDown(KeyEventArgs)
protected override void OnKeyDown(KeyEventArgs e);
Parameters
OnKeyUp(KeyEventArgs)
protected override void OnKeyUp(KeyEventArgs e);
Parameters
OnLostMouseCapture(MouseEventArgs)
protected override void OnLostMouseCapture(MouseEventArgs e);
Parameters
OnMouseDown(MouseButtonEventArgs)
protected override void OnMouseDown(MouseButtonEventArgs e);
Parameters
OnMouseMove(MouseEventArgs)
protected override void OnMouseMove(MouseEventArgs e);
Parameters
OnMouseUp(MouseButtonEventArgs)
protected override void OnMouseUp(MouseButtonEventArgs e);
Parameters
OnMouseWheel(MouseWheelEventArgs)
protected override void OnMouseWheel(MouseWheelEventArgs e);
Parameters
ResetViewport()
public void ResetViewport();
SetViewportLocation(Point)
protected void SetViewportLocation(Point location);
Parameters
location Point
UpdatePanning(Point)
Sets the viewport location to the specified location.
public void UpdatePanning(Point location);
Parameters
location Point: The location to pan the viewport to.
UpdatePanning(Vector)
Pans the viewport by the specified amount.
public void UpdatePanning(Vector amount);
Parameters
amount Vector: The amount to pan the viewport.
ZoomAtPosition(Double, Point)
Zoom at the specified location in graph space coordinates.
public void ZoomAtPosition(double zoom, Point location);
Parameters
zoom Double: The zoom factor.
location Point: The location to focus when zooming.
ZoomIn()
Zoom in at the viewport's center.
public void ZoomIn();
ZoomOut()
Zoom out at the viewport's center.
public void ZoomOut();
Events
Zoom
Triggered when zooming in or out using the mouse wheel.
public event ZoomEventHandler Zoom;
Event Type