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
viewportViewport3DThe viewport.
eventHandlerModelsEventHandler<ModelsSelectedEventArgs>The selection event handler for models.
eventHandlerVisualsEventHandler<VisualsSelectedEventArgs>The selection event handler for visuals.
Fields
Viewport
The viewport of the command.
protected readonly Viewport3D Viewport
Field Value
Properties
MouseDownPoint
Gets the mouse down point (2D screen coordinates).
protected Point MouseDownPoint { get; }
Property Value
SelectionHitMode
Gets or sets the selection hit mode.
public SelectionHitMode SelectionHitMode { get; set; }
Property Value
Methods
CanExecute(object?)
Checks whether the command can be executed.
public bool CanExecute(object? parameter)
Parameters
parameterobjectThe parameter.
Returns
- bool
trueif the command can be executed. Otherwise, it returnsfalse.
Completed(ManipulationEventArgs)
Occurs when the manipulation is completed.
protected virtual void Completed(ManipulationEventArgs e)
Parameters
eManipulationEventArgsThe ManipulationEventArgs instance containing the event data.
Delta(ManipulationEventArgs)
Occurs when the position is changed during a manipulation.
protected virtual void Delta(ManipulationEventArgs e)
Parameters
eManipulationEventArgsThe ManipulationEventArgs instance containing the event data.
Execute(object?)
Executes the command.
public void Execute(object? parameter)
Parameters
parameterobjectThe 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
OnModelsSelected(ModelsSelectedEventArgs)
Raises the ModelsSelected event.
protected virtual void OnModelsSelected(ModelsSelectedEventArgs e)
Parameters
eModelsSelectedEventArgsThe ModelsSelectedEventArgs instance containing the event data.
OnMouseDown(object?)
Called when the mouse button is pressed down.
protected virtual void OnMouseDown(object? sender)
Parameters
senderobjectThe sender.
OnMouseMove(object?, MouseEventArgs)
Called when the mouse is move on the control.
protected virtual void OnMouseMove(object? sender, MouseEventArgs e)
Parameters
senderobjectThe sender.
eMouseEventArgsThe event arguments.
OnMouseUp(object?, MouseButtonEventArgs)
Called when the mouse button is released.
protected virtual void OnMouseUp(object? sender, MouseButtonEventArgs e)
Parameters
senderobjectThe sender.
eMouseButtonEventArgsThe event arguments.
OnVisualsSelected(VisualsSelectedEventArgs)
Raises the VisualsSelected event.
protected virtual void OnVisualsSelected(VisualsSelectedEventArgs e)
Parameters
eVisualsSelectedEventArgsThe VisualsSelectedEventArgs instance containing the event data.
Started(ManipulationEventArgs)
Occurs when the manipulation is started.
protected virtual void Started(ManipulationEventArgs e)
Parameters
eManipulationEventArgsThe ManipulationEventArgs instance containing the event data.
Events
CanExecuteChanged
Occurs when CanExecute(object?) is changed.
public event EventHandler? CanExecuteChanged