pub struct Design;Expand description
Helper class for design-time property support.
Implementations§
Source§impl Design
impl Design
Sourcepub fn is_design_mode() -> bool
pub 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.
Sourcepub fn height_property() -> &'static AttachedProperty<f64>
pub fn height_property() -> &'static AttachedProperty<f64>
Defines the Height attached property: a height for the control
that is applied at design time only.
Sourcepub fn set_height(control: &Control, value: f64)
pub fn set_height(control: &Control, value: f64)
Sets the design-time height for a control.
Sourcepub fn get_height(control: &Control) -> f64
pub fn get_height(control: &Control) -> f64
Gets the design-time height for a control.
Sourcepub fn width_property() -> &'static AttachedProperty<f64>
pub fn width_property() -> &'static AttachedProperty<f64>
Defines the Width attached property: a width for the control
that is applied at design time only.
Sourcepub fn data_context_property() -> &'static AttachedProperty<Option<BoxedValue>>
pub 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.
Sourcepub fn set_data_context(control: &Control, value: Option<BoxedValue>)
pub fn set_data_context(control: &Control, value: Option<BoxedValue>)
Sets the design-time data context for a control.
Sourcepub fn get_data_context(control: &Control) -> Option<BoxedValue>
pub fn get_data_context(control: &Control) -> Option<BoxedValue>
Gets the design-time data context for a control.
Sourcepub fn set_data_context_for_data_template(
control: &Rc<dyn IDataTemplate>,
value: Option<BoxedValue>,
)
pub fn set_data_context_for_data_template( control: &Rc<dyn IDataTemplate>, value: Option<BoxedValue>, )
Sets the design-time data context for a data template.
Sourcepub fn get_data_context_for_data_template(
control: &Rc<dyn IDataTemplate>,
) -> Option<BoxedValue>
pub fn get_data_context_for_data_template( control: &Rc<dyn IDataTemplate>, ) -> Option<BoxedValue>
Gets the design-time data context for a data template.
Sourcepub fn preview_with_property() -> &'static AttachedProperty<Option<Ref<Control>>>
pub fn preview_with_property() -> &'static AttachedProperty<Option<Ref<Control>>>
Defines the PreviewWith attached property: a control that
hosts the object in the previewer.
Sourcepub fn set_preview_with_template(
target: &Ref<FerroObject>,
template: Option<PreviewTemplate>,
)
pub 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.
Sourcepub fn set_preview_with(
target: &Ref<FerroObject>,
control: Option<Ref<Control>>,
)
pub 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.
Sourcepub fn set_preview_with_template_for_data_template(
target: &Rc<dyn IDataTemplate>,
template: Option<PreviewTemplate>,
)
pub 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.
Sourcepub fn set_preview_with_for_data_template(
target: &Rc<dyn IDataTemplate>,
control: Option<Ref<Control>>,
)
pub 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.
Sourcepub fn set_preview_with_template_for_style(
target: &Rc<dyn IStyle>,
template: Option<PreviewTemplate>,
)
pub 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.
Sourcepub fn set_preview_with_for_style(
target: &Rc<dyn IStyle>,
control: Option<Ref<Control>>,
)
pub 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.
Sourcepub fn get_preview_with(target: &FerroObject) -> Option<Ref<Control>>
pub fn get_preview_with(target: &FerroObject) -> Option<Ref<Control>>
Gets the preview control for the specified object at design time, if one is set.
Sourcepub fn get_preview_with_for_data_template(
target: &Rc<dyn IDataTemplate>,
) -> Option<Ref<Control>>
pub 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.
Sourcepub fn get_preview_with_for_style(
target: &Rc<dyn IStyle>,
) -> Option<Ref<Control>>
pub 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.
Sourcepub fn design_style_property() -> &'static AttachedProperty<Option<DesignStyleValue>>
pub 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.
Sourcepub fn set_design_style(control: &Control, value: Rc<dyn IStyle>)
pub fn set_design_style(control: &Control, value: Rc<dyn IStyle>)
Sets the design-time style for a control.
Sourcepub fn get_design_style(control: &Control) -> Option<Rc<dyn IStyle>>
pub fn get_design_style(control: &Control) -> Option<Rc<dyn IStyle>>
Gets the design-time style for a control.
Sourcepub fn apply_design_mode_properties(target: &Control, source: &Control)
pub fn apply_design_mode_properties(target: &Control, source: &Control)
Applies the design-time properties set on source to target.
Trait Implementations§
Source§impl MarkupTyped for Design
impl MarkupTyped for Design
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl Freeze for Design
impl RefUnwindSafe for Design
impl Send for Design
impl Sync for Design
impl Unpin for Design
impl UnsafeUnpin for Design
impl UnwindSafe for Design
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more