Class DiagramEvent

GoDiagram®
v10.0.12
by Northwoods Software®

A DiagramEvent represents a more abstract event than an InputEvent. They are raised on the Diagram class.

Inheritance
DiagramEvent
Namespace: Northwoods.Go
Assembly: Northwoods.GoDiagram.Avalonia.dll
Syntax
public class DiagramEvent
Remarks

One can receive such events by registering a DiagramEvent listener on a Diagram. The listener function, when called, will be passed an instance of a DiagramEvent. Use the Name property to decide what kind of diagram event it is. The Diagram property refers to the Diagram, and you can get additional information from that, such as the LastInput, which in turn provides information such as DocumentPoint that may be relevant for that kind of DiagramEvent.

The Subject and Parameter properties optionally provide additional information about the diagram event. The subject could be a collection of Parts or it could be an individual object such as a Link or a GraphObject within a Node. Everything depends on the kind of diagram event that it is.

Some DiagramEvents such as "ElementSingleClicked" or "BackgroundDoubleClicked" are normally associated with InputEvents. Some DiagramEvents such as "SelectionMoved" or "PartRotated" are associated with the results of Tool-handled gestures or CommandHandler actions. Some DiagramEvents are not necessarily associated with any input events at all, such as "ViewportBoundsChanged", which can happen due to programmatic changes to the Position and Scale properties.

DiagramEvents that occur during a transaction may be called before the state of the whole diagram has settled down. This often means that such events occur before a layout, so nodes may not have their final positions, links may not have their final routes, and the DocumentBounds and ViewportBounds may not yet have been updated. Such events may make additional changes to the diagram, which may in turn result in additional side-effects.

DiagramEvents that occur outside of a transaction require you to start and commit a transaction around any side-effects that you want to do. However, some DiagramEvents do not allow you to make any changes to the Diagram or Model.

Currently defined diagram event names are part of the DiagramEventName enumeration.

Constructors

DiagramEvent()

The DiagramEvent class constructor produces an empty DiagramEvent.

Declaration
public DiagramEvent()
Remarks

You should never need to call this constructor. But if you do, you must first set Diagram to the Diagram before any other use.

DiagramEvent(DiagramEvent)

Make a copy of a DiagramEvent.

Declaration
public DiagramEvent(DiagramEvent evt)
Parameters
Type Name Description
DiagramEvent evt

Properties

Diagram

Gets or sets the diagram associated with the event.

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

Name

Gets or sets the name of the kind of diagram event that this represents.

Declaration
public DiagramEventName Name { get; set; }
Property Value
Type Description
DiagramEventName

Parameter

Gets or sets an optional object that describes the change to the subject of the diagram event.

Declaration
public object Parameter { get; set; }
Property Value
Type Description
object
Remarks

This property defaults to null.

Subject

Gets or sets an optional object that is the subject of the diagram event.

Declaration
public object Subject { get; set; }
Property Value
Type Description
object
Remarks

This property defaults to null.