Επεξεργασία

Κοινή χρήση μέσω


Behavior.DisableAllCommands Property

Definition

Gets a value indicating whether MenuCommand objects should be disabled.

public:
 virtual property bool DisableAllCommands { bool get(); };
public virtual bool DisableAllCommands { get; }
member this.DisableAllCommands : bool
Public Overridable ReadOnly Property DisableAllCommands As Boolean

Property Value

true if all MenuCommand objects the designer receives should have states set to Enabled = false when this Behavior is active; otherwise, false.

Remarks

A true value for the DisableAllCommands property indicates to the BehaviorService that all MenuCommand objects the designer receives should have their state disabled when this behavior is active.

The DisableAllCommands property works in conjunction with the FindCommand method so you can customize the interaction between glyphs and behaviors. The following table summarizes the results of a call to FindCommand for a particular MenuCommand.

DisableAllCommands is true DisableAllCommands is false
Hit-tested glyph has an assigned behavior If the MenuCommand with the specified command ID is found in the IMenuCommandService, that MenuCommand is disabled and returned. Otherwise, null is returned. FindCommand is called on the behavior and, if found, the behavior's MenuCommand is returned. Otherwise, the result of IMenuCommandService.FindCommand with the specified command ID is returned.
Hit-tested glyph has no assigned behavior The result of IMenuCommandService.FindCommand with the specified command ID is returned. The result of IMenuCommandService.FindCommand with the specified command ID is returned.

Notes to Inheritors

The default implementation always returns false.

Applies to

See also