Class BehaviorBase
Base class for behaviors with default no-op implementations.
public abstract class BehaviorBase : IBehavior
- Inheritance
-
BehaviorBase
- Implements
- Inherited Members
Properties
ActiveInStates
Override to restrict this behavior to specific states. Return null (default) to be active in all states.
public virtual IReadOnlySet<string>? ActiveInStates { get; }
Property Value
IsEnabled
Whether this behavior is currently active. Disabled behaviors receive no events.
public bool IsEnabled { get; set; }
Property Value
Name
Display name for debugging and UI purposes.
public abstract string Name { get; }
Property Value
Priority
Priority relative to other behaviors. Higher = called first. Default behaviors use 0. Use negative for "always last" behaviors.
public virtual int Priority { get; }
Property Value
Methods
IsActiveInState(string)
Checks if this behavior should be invoked for the given state. Default: active in all states if ActiveInStates is null/empty.
public bool IsActiveInState(string stateName)
Parameters
stateNamestring
Returns
OnAfterKeyDown(IGraphInputEvent)
Called after key down has been processed.
public virtual void OnAfterKeyDown(IGraphInputEvent e)
Parameters
OnAfterPointerMoved(IGraphInputEvent)
Called after pointer moved has been processed.
public virtual void OnAfterPointerMoved(IGraphInputEvent e)
Parameters
OnAfterPointerPressed(IGraphInputEvent)
Called after pointer pressed has been processed.
public virtual void OnAfterPointerPressed(IGraphInputEvent e)
Parameters
OnAfterPointerReleased(IGraphInputEvent)
Called after pointer released has been processed.
public virtual void OnAfterPointerReleased(IGraphInputEvent e)
Parameters
OnAfterPointerWheel(IGraphInputEvent)
Called after wheel/scroll has been processed.
public virtual void OnAfterPointerWheel(IGraphInputEvent e)
Parameters
OnAttached(Graph)
Called when the behavior is attached to a graph canvas.
public virtual void OnAttached(Graph graph)
Parameters
graphGraph
OnBeforeKeyDown(IGraphInputEvent)
Called before key down is processed.
public virtual BehaviorResult OnBeforeKeyDown(IGraphInputEvent e)
Parameters
Returns
OnBeforePointerMoved(IGraphInputEvent)
Called before pointer moved is processed.
public virtual BehaviorResult OnBeforePointerMoved(IGraphInputEvent e)
Parameters
Returns
OnBeforePointerPressed(IGraphInputEvent)
Called before pointer pressed is processed. Return HandledSuppress to prevent default handling.
public virtual BehaviorResult OnBeforePointerPressed(IGraphInputEvent e)
Parameters
Returns
OnBeforePointerReleased(IGraphInputEvent)
Called before pointer released is processed.
public virtual BehaviorResult OnBeforePointerReleased(IGraphInputEvent e)
Parameters
Returns
OnBeforePointerWheel(IGraphInputEvent)
Called before wheel/scroll is processed.
public virtual BehaviorResult OnBeforePointerWheel(IGraphInputEvent e)
Parameters
Returns
OnDetached()
Called when the behavior is detached from a graph canvas.
public virtual void OnDetached()