Design
struct · ferroui-controls · v0.5.0
struct Design
Helper class for design-time property support.
Members
TYPEis_design_modeheight_propertyset_heightget_heightwidth_propertyset_widthget_widthdata_context_propertyset_data_contextget_data_contextset_data_context_for_data_templateget_data_context_for_data_templatepreview_with_propertyset_preview_with_templateset_preview_withset_preview_with_template_for_data_templateset_preview_with_for_data_templateset_preview_with_template_for_styleset_preview_with_for_styleget_preview_withget_preview_with_for_data_templateget_preview_with_for_styledesign_style_propertyset_design_styleget_design_styleapply_design_mode_properties
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this type.
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.
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.
set_height
fn set_height(control: &Control, value: f64)
Sets the design-time height for a control.
get_height
fn get_height(control: &Control) -> f64
Gets the design-time height for a control.
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.
set_width
fn set_width(control: &Control, value: f64)
Sets the design-time width for a control.
get_width
fn get_width(control: &Control) -> f64
Gets the design-time width for a control.
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.
set_data_context
fn set_data_context(control: &Control, value: Option<BoxedValue>)
Sets the design-time data context for a control.
get_data_context
fn get_data_context(control: &Control) -> Option<BoxedValue>
Gets the design-time data context for a control.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
set_design_style
fn set_design_style(control: &Control, value: Rc<dyn IStyle>)
Sets the design-time style for a control.
get_design_style
fn get_design_style(control: &Control) -> Option<Rc<dyn IStyle>>
Gets the design-time style for a control.
apply_design_mode_properties
fn apply_design_mode_properties(target: &Control, source: &Control)
Applies the design-time properties set on source to target.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherMarkupTypedStaticType
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.