Skip to main content

Design

Struct Design 

Source
pub struct Design;
Expand description

Helper class for design-time property support.

Implementations§

Source§

impl Design

Source

pub const TYPE: &'static TypeInfo = <Design as ::ferroui_base::StaticType>::TYPE

The runtime type of this type.

Source§

impl Design

Source

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.

Source

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

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

Source

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

Sets the design-time height for a control.

Source

pub fn get_height(control: &Control) -> f64

Gets the design-time height for a control.

Source

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

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

Source

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

Sets the design-time width for a control.

Source

pub fn get_width(control: &Control) -> f64

Gets the design-time width for a control.

Source

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.

Source

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

Sets the design-time data context for a control.

Source

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

Gets the design-time data context for a control.

Source

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.

Source

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

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

Source

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

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Sets the design-time style for a control.

Source

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

Gets the design-time style for a control.

Source

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

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl StaticType for Design

Source§

const TYPE: &'static TypeInfo

The runtime type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.