Table of Contents

Class SelectionCommand

Namespace
HelixToolkit.Wpf
Assembly
HelixToolkit.Wpf.dll

Provides an abstract base class for mouse selection commands.

public abstract class SelectionCommand : ICommand
Inheritance
SelectionCommand
Implements
Derived
Inherited Members

Constructors

SelectionCommand(Viewport3D, EventHandler<ModelsSelectedEventArgs>?, EventHandler<VisualsSelectedEventArgs>?)

Initializes a new instance of the SelectionCommand class.

protected SelectionCommand(Viewport3D viewport, EventHandler<ModelsSelectedEventArgs>? eventHandlerModels, EventHandler<VisualsSelectedEventArgs>? eventHandlerVisuals)

Parameters

viewport Viewport3D

The viewport.

eventHandlerModels EventHandler<ModelsSelectedEventArgs>

The selection event handler for models.

eventHandlerVisuals EventHandler<VisualsSelectedEventArgs>

The selection event handler for visuals.

Fields

Viewport

The viewport of the command.

protected readonly Viewport3D Viewport

Field Value

Viewport3D

Properties

MouseDownPoint

Gets the mouse down point (2D screen coordinates).

protected Point MouseDownPoint { get; }

Property Value

Point

SelectionHitMode

Gets or sets the selection hit mode.

public SelectionHitMode SelectionHitMode { get; set; }

Property Value

SelectionHitMode

Methods

CanExecute(object?)

Checks whether the command can be executed.

public bool CanExecute(object? parameter)

Parameters

parameter object

The parameter.

Returns

bool

true if the command can be executed. Otherwise, it returns false.

Completed(ManipulationEventArgs)

Occurs when the manipulation is completed.

protected virtual void Completed(ManipulationEventArgs e)

Parameters

e ManipulationEventArgs

The ManipulationEventArgs instance containing the event data.

Delta(ManipulationEventArgs)

Occurs when the position is changed during a manipulation.

protected virtual void Delta(ManipulationEventArgs e)

Parameters

e ManipulationEventArgs

The ManipulationEventArgs instance containing the event data.

Execute(object?)

Executes the command.

public void Execute(object? parameter)

Parameters

parameter object

The parameter.

GetCursor()

Gets the cursor for the gesture.

protected abstract Cursor GetCursor()

Returns

Cursor

A cursor.

OnCanExecutedChanged(object?, EventArgs)

Called when the condition of execution is changed.

protected virtual void OnCanExecutedChanged(object? sender, EventArgs e)

Parameters

sender object

The sender.

e EventArgs

The event arguments.

OnModelsSelected(ModelsSelectedEventArgs)

Raises the ModelsSelected event.

protected virtual void OnModelsSelected(ModelsSelectedEventArgs e)

Parameters

e ModelsSelectedEventArgs

The ModelsSelectedEventArgs instance containing the event data.

OnMouseDown(object?)

Called when the mouse button is pressed down.

protected virtual void OnMouseDown(object? sender)

Parameters

sender object

The sender.

OnMouseMove(object?, MouseEventArgs)

Called when the mouse is move on the control.

protected virtual void OnMouseMove(object? sender, MouseEventArgs e)

Parameters

sender object

The sender.

e MouseEventArgs

The event arguments.

OnMouseUp(object?, MouseButtonEventArgs)

Called when the mouse button is released.

protected virtual void OnMouseUp(object? sender, MouseButtonEventArgs e)

Parameters

sender object

The sender.

e MouseButtonEventArgs

The event arguments.

OnVisualsSelected(VisualsSelectedEventArgs)

Raises the VisualsSelected event.

protected virtual void OnVisualsSelected(VisualsSelectedEventArgs e)

Parameters

e VisualsSelectedEventArgs

The VisualsSelectedEventArgs instance containing the event data.

Started(ManipulationEventArgs)

Occurs when the manipulation is started.

protected virtual void Started(ManipulationEventArgs e)

Parameters

e ManipulationEventArgs

The ManipulationEventArgs instance containing the event data.

Events

CanExecuteChanged

Occurs when CanExecute(object?) is changed.

public event EventHandler? CanExecuteChanged

Event Type

EventHandler