TemplatedControl
struct · ferroui-controls · v0.5.0
struct TemplatedControl
A lookless control whose visual appearance is defined by its Template.
Members
TYPEto_refon_apply_templateon_template_changedbackground_propertybackground_sizing_propertyborder_brush_propertyborder_thickness_propertycorner_radius_propertyfont_family_propertyfont_features_propertyfont_size_propertyfont_style_propertyfont_weight_propertyfont_stretch_propertyforeground_propertyletter_spacing_propertypadding_propertytemplate_propertyis_template_focus_target_propertytemplate_applied_eventconstructnewtemplate_appliedbackgroundset_backgroundbackground_sizingset_background_sizingborder_brushset_border_brushborder_thicknessset_border_thicknesscorner_radiusset_corner_radiusfont_familyset_font_familyfont_featuresset_font_featuresfont_sizeset_font_sizefont_styleset_font_stylefont_weightset_font_weightfont_stretchset_font_stretchforegroundset_foregroundletter_spacingset_letter_spacingpaddingset_paddingtemplateset_templateget_is_template_focus_targetset_is_template_focus_targetapply_templated_parentget_template_childrenget_template_descendants
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<TemplatedControl>
Returns a strong reference to this object.
on_apply_template
fn on_apply_template(self: &Self, e: &TemplateAppliedEventArgs)
Called when the control's template is applied.
In simple terms, this means the method is called just before the control is displayed.
on_template_changed
fn on_template_changed(self: &Self, e: &FerroPropertyChangedEventArgs<'_>)
Called when the Template property changes.
background_property
fn background_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the Background property.
background_sizing_property
fn background_sizing_property() -> &'static StyledProperty<BackgroundSizing>
Defines the BackgroundSizing property.
border_brush_property
fn border_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the BorderBrush property.
border_thickness_property
fn border_thickness_property() -> &'static StyledProperty<Thickness>
Defines the BorderThickness property.
corner_radius_property
fn corner_radius_property() -> &'static StyledProperty<CornerRadius>
Defines the CornerRadius property.
font_family_property
fn font_family_property() -> &'static StyledProperty<FontFamily>
Defines the FontFamily property.
font_features_property
fn font_features_property() -> &'static StyledProperty<Option<FontFeatureCollection>>
Defines the FontFeatures property.
font_size_property
fn font_size_property() -> &'static StyledProperty<f64>
Defines the FontSize property.
font_style_property
fn font_style_property() -> &'static StyledProperty<FontStyle>
Defines the FontStyle property.
font_weight_property
fn font_weight_property() -> &'static StyledProperty<FontWeight>
Defines the FontWeight property.
font_stretch_property
fn font_stretch_property() -> &'static StyledProperty<FontStretch>
Defines the FontStretch property.
foreground_property
fn foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the Foreground property.
letter_spacing_property
fn letter_spacing_property() -> &'static StyledProperty<f64>
Defines the LetterSpacing property.
padding_property
fn padding_property() -> &'static StyledProperty<Thickness>
Defines the Padding property.
template_property
fn template_property() -> &'static StyledProperty<Option<Rc<dyn IControlTemplate>>>
Defines the Template property.
is_template_focus_target_property
fn is_template_focus_target_property() -> &'static AttachedProperty<bool>
Defines the IsTemplateFocusTarget attached property.
template_applied_event
fn template_applied_event() -> &'static RoutedEvent<TemplateAppliedEventArgs>
Defines the TemplateApplied routed event.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
template_applied
fn template_applied(self: &Self, handler: impl Fn(&Interactive, &TemplateAppliedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
Raised when the control's template is applied.
background
fn background(self: &Self) -> Option<Rc<dyn IBrush>>
The brush used to draw the control's background.
set_background
fn set_background(self: &Self, value: Option<Rc<dyn IBrush>>)
background_sizing
fn background_sizing(self: &Self) -> BackgroundSizing
How the control's background is drawn relative to the control's border.
set_background_sizing
fn set_background_sizing(self: &Self, value: BackgroundSizing)
border_brush
fn border_brush(self: &Self) -> Option<Rc<dyn IBrush>>
The brush used to draw the control's border.
set_border_brush
fn set_border_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
border_thickness
fn border_thickness(self: &Self) -> Thickness
The thickness of the control's border.
set_border_thickness
fn set_border_thickness(self: &Self, value: Thickness)
corner_radius
fn corner_radius(self: &Self) -> CornerRadius
The radius of the border rounded corners.
set_corner_radius
fn set_corner_radius(self: &Self, value: CornerRadius)
font_family
fn font_family(self: &Self) -> FontFamily
The font family used to draw the control's text.
set_font_family
fn set_font_family(self: &Self, value: FontFamily)
font_features
fn font_features(self: &Self) -> Option<FontFeatureCollection>
The font features turned on/off.
set_font_features
fn set_font_features(self: &Self, value: Option<FontFeatureCollection>)
font_size
fn font_size(self: &Self) -> f64
The size of the control's text in points.
set_font_size
fn set_font_size(self: &Self, value: f64)
font_style
fn font_style(self: &Self) -> FontStyle
The font style used to draw the control's text.
set_font_style
fn set_font_style(self: &Self, value: FontStyle)
font_weight
fn font_weight(self: &Self) -> FontWeight
The font weight used to draw the control's text.
set_font_weight
fn set_font_weight(self: &Self, value: FontWeight)
font_stretch
fn font_stretch(self: &Self) -> FontStretch
The font stretch used to draw the control's text.
set_font_stretch
fn set_font_stretch(self: &Self, value: FontStretch)
foreground
fn foreground(self: &Self) -> Option<Rc<dyn IBrush>>
The brush used to draw the control's text and other foreground elements.
set_foreground
fn set_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
letter_spacing
fn letter_spacing(self: &Self) -> f64
The letter spacing for the control's text content.
set_letter_spacing
fn set_letter_spacing(self: &Self, value: f64)
padding
fn padding(self: &Self) -> Thickness
The padding placed between the border of the control and its content.
set_padding
fn set_padding(self: &Self, value: Thickness)
template
fn template(self: &Self) -> Option<Rc<dyn IControlTemplate>>
The template that defines the control's appearance.
set_template
fn set_template(self: &Self, value: Option<Rc<dyn IControlTemplate>>)
get_is_template_focus_target
fn get_is_template_focus_target(control: &Control) -> bool
Gets the value of the IsTemplateFocusTarget attached property on a
control.
set_is_template_focus_target
fn set_is_template_focus_target(control: &Control, value: bool)
Sets the value of the IsTemplateFocusTarget attached property on a
control.
When a control is navigated to using the keyboard, a focus adorner is shown - usually around the control itself. However if the templated control has a template child with this attached property set to true, the focus adorner is shown around that control instead.
apply_templated_parent
fn apply_templated_parent(control: &StyledElement, templated_parent: Option<&Ref<FerroObject>>)
Sets the templated parent of a control and of its logical descendants that do not have one yet.
get_template_children
fn get_template_children(self: &Self) -> Vec<Ref<Control>>
Gets the list of all control descendants that are part of the template of this control: the template descendants that are controls.
Deprecated. Use get_template_descendants
get_template_descendants
fn get_template_descendants(self: &Self) -> Vec<Ref<Visual>>
Gets a visual tree's template descendants: the visual descendants whose templated parent is this control.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<TemplatedControl>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleVisualImplInteractiveImplInputElementImplFerroObjectImplStyledElementImplLayoutableImplControlImplTemplatedControlImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.