FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Design

    struct · ferroui-controls · v0.5.0

    struct Design
    

    Helper class for design-time property support.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this type.

    Source

    is_design_mode

    fn is_design_mode() -> bool
    

    Whether the application is running in design mode.

    This property is set by the previewer when it hosts the application; it is false in a running application.

    Source

    height_property

    fn height_property() -> &'static AttachedProperty<f64>
    

    Defines the Height attached property: a height for the control that is applied at design time only.

    Source

    set_height

    fn set_height(control: &Control, value: f64)
    

    Sets the design-time height for a control.

    Source

    get_height

    fn get_height(control: &Control) -> f64
    

    Gets the design-time height for a control.

    Source

    width_property

    fn width_property() -> &'static AttachedProperty<f64>
    

    Defines the Width attached property: a width for the control that is applied at design time only.

    Source

    set_width

    fn set_width(control: &Control, value: f64)
    

    Sets the design-time width for a control.

    Source

    get_width

    fn get_width(control: &Control) -> f64
    

    Gets the design-time width for a control.

    Source

    data_context_property

    fn data_context_property() -> &'static AttachedProperty<Option<BoxedValue>>
    

    Defines the DataContext attached property: a data context for the control that is applied at design time only.

    Source

    set_data_context

    fn set_data_context(control: &Control, value: Option<BoxedValue>)
    

    Sets the design-time data context for a control.

    Source

    get_data_context

    fn get_data_context(control: &Control) -> Option<BoxedValue>
    

    Gets the design-time data context for a control.

    Source

    set_data_context_for_data_template

    fn set_data_context_for_data_template(control: &Rc<dyn IDataTemplate>, value: Option<BoxedValue>)
    

    Sets the design-time data context for a data template.

    Source

    get_data_context_for_data_template

    fn get_data_context_for_data_template(control: &Rc<dyn IDataTemplate>) -> Option<BoxedValue>
    

    Gets the design-time data context for a data template.

    Source

    preview_with_property

    fn preview_with_property() -> &'static AttachedProperty<Option<Ref<Control>>>
    

    Defines the PreviewWith attached property: a control that hosts the object in the previewer.

    Source

    set_preview_with_template

    fn set_preview_with_template(target: &Ref<FerroObject>, template: Option<PreviewTemplate>)
    

    Sets a preview template for the specified object at design time.

    This method allows you to specify a substitute control template to be used to preview the given object in the previewer.

    Source

    set_preview_with

    fn set_preview_with(target: &Ref<FerroObject>, control: Option<Ref<Control>>)
    

    Sets a preview control for the specified object at design time.

    This method allows you to specify a substitute control to be used to preview the given object in the previewer. A visual cannot be previewed with a control: it needs a template.

    Source

    set_preview_with_template_for_data_template

    fn set_preview_with_template_for_data_template(target: &Rc<dyn IDataTemplate>, template: Option<PreviewTemplate>)
    

    Sets a preview template for the specified data template at design time.

    Source

    set_preview_with_for_data_template

    fn set_preview_with_for_data_template(target: &Rc<dyn IDataTemplate>, control: Option<Ref<Control>>)
    

    Sets a preview control for the specified data template at design time.

    Source

    set_preview_with_template_for_style

    fn set_preview_with_template_for_style(target: &Rc<dyn IStyle>, template: Option<PreviewTemplate>)
    

    Sets a preview template for the specified style at design time.

    Source

    set_preview_with_for_style

    fn set_preview_with_for_style(target: &Rc<dyn IStyle>, control: Option<Ref<Control>>)
    

    Sets a preview control for the specified style at design time.

    Source

    get_preview_with

    fn get_preview_with(target: &FerroObject) -> Option<Ref<Control>>
    

    Gets the preview control for the specified object at design time, if one is set.

    Source

    get_preview_with_for_data_template

    fn get_preview_with_for_data_template(target: &Rc<dyn IDataTemplate>) -> Option<Ref<Control>>
    

    Gets the preview control for the specified data template at design time, if one is set.

    Source

    get_preview_with_for_style

    fn get_preview_with_for_style(target: &Rc<dyn IStyle>) -> Option<Ref<Control>>
    

    Gets the preview control for the specified style at design time, if one is set.

    Source

    design_style_property

    fn design_style_property() -> &'static AttachedProperty<Option<DesignStyleValue>>
    

    Defines the DesignStyle attached property for design-time use.

    This property allows you to apply a style to a control only at design-time, enabling custom visualizations or highlighting in the designer without affecting the runtime appearance.

    Source

    set_design_style

    fn set_design_style(control: &Control, value: Rc<dyn IStyle>)
    

    Sets the design-time style for a control.

    Source

    get_design_style

    fn get_design_style(control: &Control) -> Option<Rc<dyn IStyle>>
    

    Gets the design-time style for a control.

    Source

    apply_design_mode_properties

    fn apply_design_mode_properties(target: &Control, source: &Control)
    

    Applies the design-time properties set on source to target.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • MarkupTyped
    • StaticType

    Availability

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