ExecuteCommandBehaviorBase
struct · ferroui-xaml-interactions-custom · v0.5.0
struct ExecuteCommandBehaviorBase
The base class of the behaviors that execute a command (the ExecuteCommandOn*Behavior
classes): the command, its parameter, whether it can execute, and the element to focus when it
runs.
The class is abstract: a deriving class implements
AttachedToVisualTreeBehaviorImpl::on_attached_to_visual_tree_override to listen for its
event while the control is in the visual tree, and calls
execute_command when it fires.
Members
TYPEto_refexecute_commandtop_level_propertycommand_propertycan_execute_command_propertycommand_parameter_propertyfocus_top_level_propertyfocus_control_propertysource_control_propertyconstructtop_levelset_top_levelcommandset_commandcan_execute_commandcommand_parameterset_command_parameterfocus_top_levelset_focus_top_levelfocus_controlset_focus_controlsource_controlset_source_control
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ExecuteCommandBehaviorBase>
Returns a strong reference to this object.
execute_command
fn execute_command(self: &Self) -> bool
Executes the associated command.
Returns true if the command was executed; otherwise, false.
top_level_property
fn top_level_property() -> &'static StyledProperty<Option<ElementRef<TopLevel>>>
Identifies the TopLevel property.
Deviation (DEVIATIONS.md, Behaviors): the behavior does not own the top level, so the value is an element reference.
command_property
fn command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Identifies the Command property.
can_execute_command_property
fn can_execute_command_property() -> &'static DirectProperty<ExecuteCommandBehaviorBase, bool>
Identifies the CanExecuteCommand property.
command_parameter_property
fn command_parameter_property() -> &'static StyledProperty<Option<BoxedValue>>
Identifies the CommandParameter property.
focus_top_level_property
fn focus_top_level_property() -> &'static StyledProperty<bool>
Identifies the FocusTopLevel property.
focus_control_property
fn focus_control_property() -> &'static StyledProperty<Option<ElementRef<Control>>>
Identifies the FocusControl property.
Deviation (DEVIATIONS.md, Behaviors): the reference registers this property under the
name CommandParameter (nameof(CommandParameter)), a second property of that name;
here it is registered as FocusControl (defect corrected). The behavior does not own
the control, so the value is an element reference.
source_control_property
fn source_control_property() -> &'static StyledProperty<Option<ElementRef<Control>>>
Identifies the SourceControl property.
Deviation (DEVIATIONS.md, Behaviors): the behavior does not own the control, so the value is an element reference.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
top_level
fn top_level(self: &Self) -> Option<Ref<TopLevel>>
Gets or sets the top level to focus when focus_top_level is
set; when it is null, the root of the logical tree of the associated control.
set_top_level
fn set_top_level(self: &Self, value: impl Into<Nullable<TopLevel>>)
command
fn command(self: &Self) -> Option<Rc<dyn ICommand>>
Gets or sets the command to execute.
set_command
fn set_command(self: &Self, value: Option<Rc<dyn ICommand>>)
can_execute_command
fn can_execute_command(self: &Self) -> bool
Gets a value indicating whether command can execute with the current
command_parameter.
command_parameter
fn command_parameter(self: &Self) -> Option<BoxedValue>
Gets or sets the parameter of the command.
set_command_parameter
fn set_command_parameter(self: &Self, value: Option<BoxedValue>)
focus_top_level
fn focus_top_level(self: &Self) -> bool
Gets or sets a value indicating whether the top level is focused when the command runs.
set_focus_top_level
fn set_focus_top_level(self: &Self, value: bool)
focus_control
fn focus_control(self: &Self) -> Option<Ref<Control>>
Gets or sets the control focused when the command runs. Markup resolves a name given for it to the named element.
set_focus_control
fn set_focus_control(self: &Self, value: impl Into<Nullable<Control>>)
source_control
fn source_control(self: &Self) -> Option<Ref<Control>>
Gets or sets the control whose event the behavior listens for; when it is null, the associated control. Markup resolves a name given for it to the named element.
set_source_control
fn set_source_control(self: &Self, value: impl Into<Nullable<Control>>)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAttachedToVisualTreeBehaviorImplExtExecuteCommandBehaviorBaseImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtStyledElementImplExtClassDefaultsErasedDestructorIntoEitherDisposingBehaviorImplExtStyledElementBehaviorImplExtDerefUpcast<T>Upcast<ExecuteCommandBehaviorBase>StaticTypeObjectTypeSubclassable<T>StyledElementImplDisposingBehaviorImplAttachedToVisualTreeBehaviorImplExecuteCommandBehaviorBaseImplFerroObjectImplStyledElementBehaviorImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.