CommandHandler

StockSharp.Xaml.Diagram.GXDiagram

This class implements the handlers for all of the standard diagram commands.

Inherits: FrameworkElement

Properties

ClipboardBitmap
public bool ClipboardBitmap { get; set; }
value = commandHandler.ClipboardBitmap
commandHandler.ClipboardBitmap = value

Gets or sets whether IDataCollection) also adds a bitmap of the area of the selected parts to the system clipboard. [WPF only]

CopyCommand
public ICommand CopyCommand { get; }
value = commandHandler.CopyCommand

Gets a non-routed ICommand that executes Copy and is enabled by CanCopy.

CopyingInclusions
public EffectiveCollectionInclusions CopyingInclusions { get; set; }
value = commandHandler.CopyingInclusions
commandHandler.CopyingInclusions = value

Gets or sets whether Copy deletes only the selected parts or subtrees of selected nodes as well.

CutCommand
public ICommand CutCommand { get; }
value = commandHandler.CutCommand

Gets a non-routed ICommand that executes Cut and is enabled by CanCut.

DecreaseZoomCommand
public ICommand DecreaseZoomCommand { get; }
value = commandHandler.DecreaseZoomCommand

Gets a non-routed parameterized ICommand that executes Object) and is enabled by Object).

DeleteCommand
public ICommand DeleteCommand { get; }
value = commandHandler.DeleteCommand

Gets a non-routed ICommand that executes Delete and is enabled by CanDelete.

DeletingInclusions
public EffectiveCollectionInclusions DeletingInclusions { get; set; }
value = commandHandler.DeletingInclusions
commandHandler.DeletingInclusions = value

Gets or sets whether Delete deletes only the selected parts or subtrees of selected nodes as well.

Diagram
public Diagram Diagram { get; internal set; }
value = commandHandler.Diagram
commandHandler.Diagram = value

Gets the Diagram for which this CommandHandler executes commands.

EditCommand
public ICommand EditCommand { get; }
value = commandHandler.EditCommand

Gets a non-routed ICommand that executes Edit and is enabled by CanEdit.

GroupCommand
public ICommand GroupCommand { get; }
value = commandHandler.GroupCommand

Gets a non-routed ICommand that executes Group and is enabled by CanGroup.

IncreaseZoomCommand
public ICommand IncreaseZoomCommand { get; }
value = commandHandler.IncreaseZoomCommand

Gets a non-routed parameterized ICommand that executes Object) and is enabled by Object).

PasteCommand
public ICommand PasteCommand { get; }
value = commandHandler.PasteCommand

Gets a non-routed ICommand that executes Paste and is enabled by CanPaste.

PrintCommand
public ICommand PrintCommand { get; }
value = commandHandler.PrintCommand

Gets a non-routed ICommand that executes Print and is enabled by CanPrint.

PrototypeGroup
public object PrototypeGroup { get; set; }
value = commandHandler.PrototypeGroup
commandHandler.PrototypeGroup = value

Gets or sets a data value to be copied for a new group node by Group. In order to enable the Group command, set this property to an instance of a node data object that will be represented by a Group.

RedoCommand
public ICommand RedoCommand { get; }
value = commandHandler.RedoCommand

Gets a non-routed ICommand that executes Redo and is enabled by CanRedo.

SelectAllCommand
public ICommand SelectAllCommand { get; }
value = commandHandler.SelectAllCommand

Gets a non-routed ICommand that executes SelectAll and is enabled by CanSelectAll.

UndoCommand
public ICommand UndoCommand { get; }
value = commandHandler.UndoCommand

Gets a non-routed ICommand that executes Undo and is enabled by CanUndo.

UngroupCommand
public ICommand UngroupCommand { get; }
value = commandHandler.UngroupCommand

Gets a non-routed ICommand that executes Ungroup and is enabled by CanUngroup.

ZoomCommand
public ICommand ZoomCommand { get; }
value = commandHandler.ZoomCommand

Gets a non-routed parameterized ICommand that executes Object) and is enabled by Object).

ZoomFactor
public double ZoomFactor { get; set; }
value = commandHandler.ZoomFactor
commandHandler.ZoomFactor = value

Gets or sets the factor by which zooming occurs.

ZoomToFitCommand
public ICommand ZoomToFitCommand { get; }
value = commandHandler.ZoomToFitCommand

Gets a non-routed ICommand that executes ZoomToFit and is enabled by CanZoomToFit.

Methods

AddStandardBindings
public virtual void AddStandardBindings()
commandHandler.AddStandardBindings()

Define the standard CommandBindings and InputBindings for all of the predefined diagram Commands. [WPF only]

CanCopy
public virtual bool CanCopy()
result = commandHandler.CanCopy()

This overridable predicate controls whether or not the Copy command is executed.

Returns: by default, this returns true if AllowCopy is true, if AllowClipboard is true, and if there are some selected parts (SelectedParts).

CanCut
public virtual bool CanCut()
result = commandHandler.CanCut()

This overridable predicate controls whether or not the Cut command is executed.

Returns: by default, this returns true if the diagram is not IsReadOnly, if AllowCopy is true, if AllowDelete is true, if AllowClipboard is true, if there are some selected parts (SelectedParts), and if the model is Modifiable.

CanDecreaseZoom
public virtual bool CanDecreaseZoom(object param)
result = commandHandler.CanDecreaseZoom(param)

This overridable predicate controls whether or not the DecreaseZoom command is executed.

param
the factor by which to decrease the zoom; this defaults to 5% (1/ZoomFactor)

Returns: by default, this returns true if AllowZoom is true, and if the is a value greater than zero.

CanDelete
public virtual bool CanDelete()
result = commandHandler.CanDelete()

This overridable predicate controls whether or not the Delete command is executed.

Returns: by default, this returns true if the diagram is not IsReadOnly, if AllowDelete is true, and if there are some selected parts (SelectedParts).

CanEdit
public virtual bool CanEdit()
result = commandHandler.CanEdit()

This overridable predicate controls whether or not the Edit command is executed.

Returns: By default, this returns true: if the diagram is not IsReadOnly, if AllowEdit is true, if there are any selected parts that can be CanEdit'ed, and if there is a TextEditingTool.

CanGroup
public virtual bool CanGroup()
result = commandHandler.CanGroup()

This overridable predicate controls whether or not the Group command is executed.

Returns: By default, this returns true: if the PrototypeGroup data is not null, if the diagram is not IsReadOnly, if AllowInsert is true, if AllowGroup is true, if the model is an ISubGraphModel that is modifiable, and if there are any selected nodes that can be CanGroup'ed.

CanIncreaseZoom
public virtual bool CanIncreaseZoom(object param)
result = commandHandler.CanIncreaseZoom(param)

This overridable predicate controls whether or not the IncreaseZoom command is executed.

param
the factor by which to increase the zoom; this defaults to 5% (ZoomFactor)

Returns: by default, this returns true if AllowZoom is true, and if the is a value greater than zero.

CanPaste
public virtual bool CanPaste()
result = commandHandler.CanPaste()

This overridable predicate controls whether or not the Paste command is executed.

Returns: by default, this returns true if the diagram is not IsReadOnly, if AllowInsert is true, if AllowClipboard is true, if the clipboard has data of the format given by the diagram's model's DataFormat, and if the model is Modifiable.

CanPrint
public virtual bool CanPrint()
result = commandHandler.CanPrint()

This overridable predicate controls whether or not the Print command is executed.

Returns: By default, this returns true if AllowPrint is true and there is a PrintManager.

CanRedo
public virtual bool CanRedo()
result = commandHandler.CanRedo()

This overridable predicate controls whether or not the Redo command is executed.

Returns: by default, this returns true if the diagram is not IsReadOnly, if AllowUndo is true, and if the diagram's model's UndoManagerCanRedo predicate returns true.

CanSelectAll
public virtual bool CanSelectAll()
result = commandHandler.CanSelectAll()

This overridable predicate controls whether or not the SelectAll command is executed.

Returns: by default, this returns true if AllowSelect is true.

CanStopCommand
public virtual bool CanStopCommand()
result = commandHandler.CanStopCommand()

This overridable predicate controls whether or not the StopCommand is executed.

Returns: by default, this returns true

CanUndo
public virtual bool CanUndo()
result = commandHandler.CanUndo()

This overridable predicate controls whether or not the Undo command is executed.

Returns: by default, this returns true if the diagram is not IsReadOnly, if AllowUndo is true, and if the diagram's model's UndoManagerCanUndo predicate returns true.

CanUngroup
public virtual bool CanUngroup()
result = commandHandler.CanUngroup()

This overridable predicate controls whether or not the Ungroup command is executed.

Returns: by default, this returns true if the diagram is not IsReadOnly, if AllowDelete is true, if AllowUngroup is true, if the model is an ISubGraphModel that is modifiable, and if there are any selected Groups that can be CanUngroup'ed.

CanZoom
public virtual bool CanZoom(object param)
result = commandHandler.CanZoom(param)

This overridable predicate controls whether or not the Zoom command is executed.

param
the new Scale value; this defaults to 1

Returns: by default, this returns true if AllowZoom is true, and if the is a value greater than zero.

CanZoomToFit
public virtual bool CanZoomToFit()
result = commandHandler.CanZoomToFit()

This overridable predicate controls whether or not the ZoomToFit command is executed.

Returns: by default, this returns true if AllowZoom is true.

Copy
public virtual void Copy()
commandHandler.Copy()

Copy the currently SelectedParts from the Diagram into the clipboard.

CopyToClipboard
protected virtual void CopyToClipboard(IDataCollection coll)
commandHandler.CopyToClipboard(coll)

This writes the given data collection to the clipboard using the diagram's model's DataFormat.

coll
Cut
public virtual void Cut()
commandHandler.Cut()

Execute a Copy followed by a Delete.

DecreaseZoom
public virtual void DecreaseZoom(object param)
commandHandler.DecreaseZoom(param)

Decrease the Diagram.Panel.Scale by the given factor.

param
The factor by which to decrease the zoom. This should be less than one but greater than zero; it defaults to 5% (1/ZoomFactor).
Delete
public virtual void Delete()
commandHandler.Delete()

Delete the currently SelectedParts from the Diagram.

DoKeyDown
public virtual void DoKeyDown(KeyEventArgs e)
commandHandler.DoKeyDown(e)

This is called by the ToolManager.

e
DoKeyUp
public virtual void DoKeyUp(KeyEventArgs e)
commandHandler.DoKeyUp(e)

This is called by the ToolManager.

e
Edit
public virtual void Edit()
commandHandler.Edit()

Start in-place editing of the first TextBlock of the selected part.

Group
public virtual void Group()
commandHandler.Group()

Create a new group node and add the selected parts to that new group.

IncreaseZoom
public virtual void IncreaseZoom(object param)
commandHandler.IncreaseZoom(param)

Increase the Diagram.Panel.Scale by the given factor.

param
The factor by which to increase the zoom. This should be greater than one; it defaults to 5% (ZoomFactor).
Paste
public virtual void Paste()
commandHandler.Paste()

Copy the contents of the clipboard as new nodes and links in this diagram, and make those new parts the new selection.

PasteFromClipboard
protected virtual IDataCollection PasteFromClipboard()
result = commandHandler.PasteFromClipboard()

This reads a data collection from the clipboard using the diagram's model's DataFormat.

Returns: null if the Clipboard does not contain any data of the given format

Print
public virtual void Print()
commandHandler.Print()

Print the diagram by showing a PrintDialog and then calling the PrintManager's PrintDialog) method.

RaiseEvent
protected bool RaiseEvent(RoutedEvent evt)
result = commandHandler.RaiseEvent(evt)

This method just calls UIElement.RaiseEvent on the Diagram and returns whether the event was handled.

evt

Returns: true if the event was raised and it was Handled

Redo
public virtual void Redo()
commandHandler.Redo()

Call Diagram.Model.UndoManager.Redo.

RemoveStandardBindings
public virtual void RemoveStandardBindings()
commandHandler.RemoveStandardBindings()

Remove all of the standard diagram command bindings and input bindings. [WPF only]

SelectAll
public virtual void SelectAll()
commandHandler.SelectAll()

Select all of the Nodes and Links in the Diagram.

StopCommand
public virtual void StopCommand()
commandHandler.StopCommand()

Cancel the operation of the current CurrentTool.

Undo
public virtual void Undo()
commandHandler.Undo()

Call Diagram.Model.UndoManager.Undo.

Ungroup
public virtual void Ungroup()
commandHandler.Ungroup()

For each selected node that is a group, remove the group without removing its members from the diagram.

Zoom
public virtual void Zoom(object param)
commandHandler.Zoom(param)

Set the Scale property of the Panel to the given value.

param
The new scale value. This should be greater than zero; it defaults to 1.
ZoomToFit
public virtual void ZoomToFit()
commandHandler.ZoomToFit()

Change the Scale such that the whole diagram/document fits into the viewport; or if this command had just executed before, restore the original viewport.

Fields

ClipboardBitmapProperty
public static readonly DependencyProperty ClipboardBitmapProperty
value = CommandHandler.ClipboardBitmapProperty

Identifies the ClipboardBitmap dependency property. [WPF only]

CopyingInclusionsProperty
public static readonly DependencyProperty CopyingInclusionsProperty
value = CommandHandler.CopyingInclusionsProperty

Identifies the CopyingInclusions dependency property.

DeletingInclusionsProperty
public static readonly DependencyProperty DeletingInclusionsProperty
value = CommandHandler.DeletingInclusionsProperty

Identifies the DeletingInclusions dependency property.

PrototypeGroupProperty
public static readonly DependencyProperty PrototypeGroupProperty
value = CommandHandler.PrototypeGroupProperty

Identifies the PrototypeGroup dependency property.

ZoomFactorProperty
public static readonly DependencyProperty ZoomFactorProperty
value = CommandHandler.ZoomFactorProperty

Identifies the ZoomFactor dependency property.