FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<ExecuteCommandBehaviorBase>
    

    Returns a strong reference to this object.

    Source

    execute_command

    fn execute_command(self: &Self) -> bool
    

    Executes the associated command.

    Returns true if the command was executed; otherwise, false.

    Source

    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.

    Source

    command_property

    fn command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
    

    Identifies the Command property.

    Source

    can_execute_command_property

    fn can_execute_command_property() -> &'static DirectProperty<ExecuteCommandBehaviorBase, bool>
    

    Identifies the CanExecuteCommand property.

    Source

    command_parameter_property

    fn command_parameter_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Identifies the CommandParameter property.

    Source

    focus_top_level_property

    fn focus_top_level_property() -> &'static StyledProperty<bool>
    

    Identifies the FocusTopLevel property.

    Source

    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

    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.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    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.

    Source

    set_top_level

    fn set_top_level(self: &Self, value: impl Into<Nullable<TopLevel>>)
    

    Source

    command

    fn command(self: &Self) -> Option<Rc<dyn ICommand>>
    

    Gets or sets the command to execute.

    Source

    set_command

    fn set_command(self: &Self, value: Option<Rc<dyn ICommand>>)
    

    Source

    can_execute_command

    fn can_execute_command(self: &Self) -> bool
    

    Gets a value indicating whether command can execute with the current command_parameter.

    Source

    command_parameter

    fn command_parameter(self: &Self) -> Option<BoxedValue>
    

    Gets or sets the parameter of the command.

    Source

    set_command_parameter

    fn set_command_parameter(self: &Self, value: Option<BoxedValue>)
    

    Source

    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.

    Source

    set_focus_top_level

    fn set_focus_top_level(self: &Self, value: bool)
    

    Source

    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.

    Source

    set_focus_control

    fn set_focus_control(self: &Self, value: impl Into<Nullable<Control>>)
    

    Source

    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.

    Source

    set_source_control

    fn set_source_control(self: &Self, value: impl Into<Nullable<Control>>)
    

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.