FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TemplatedControl

    struct · ferroui-controls · v0.5.0

    struct TemplatedControl
    

    A lookless control whose visual appearance is defined by its Template.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<TemplatedControl>
    

    Returns a strong reference to this object.

    Source

    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.

    Source

    on_template_changed

    fn on_template_changed(self: &Self, e: &FerroPropertyChangedEventArgs<'_>)
    

    Called when the Template property changes.

    Source

    background_property

    fn background_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the Background property.

    Source

    background_sizing_property

    fn background_sizing_property() -> &'static StyledProperty<BackgroundSizing>
    

    Defines the BackgroundSizing property.

    Source

    border_brush_property

    fn border_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the BorderBrush property.

    Source

    border_thickness_property

    fn border_thickness_property() -> &'static StyledProperty<Thickness>
    

    Defines the BorderThickness property.

    Source

    corner_radius_property

    fn corner_radius_property() -> &'static StyledProperty<CornerRadius>
    

    Defines the CornerRadius property.

    Source

    font_family_property

    fn font_family_property() -> &'static StyledProperty<FontFamily>
    

    Defines the FontFamily property.

    Source

    font_features_property

    fn font_features_property() -> &'static StyledProperty<Option<FontFeatureCollection>>
    

    Defines the FontFeatures property.

    Source

    font_size_property

    fn font_size_property() -> &'static StyledProperty<f64>
    

    Defines the FontSize property.

    Source

    font_style_property

    fn font_style_property() -> &'static StyledProperty<FontStyle>
    

    Defines the FontStyle property.

    Source

    font_weight_property

    fn font_weight_property() -> &'static StyledProperty<FontWeight>
    

    Defines the FontWeight property.

    Source

    font_stretch_property

    fn font_stretch_property() -> &'static StyledProperty<FontStretch>
    

    Defines the FontStretch property.

    Source

    foreground_property

    fn foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the Foreground property.

    Source

    letter_spacing_property

    fn letter_spacing_property() -> &'static StyledProperty<f64>
    

    Defines the LetterSpacing property.

    Source

    padding_property

    fn padding_property() -> &'static StyledProperty<Thickness>
    

    Defines the Padding property.

    Source

    template_property

    fn template_property() -> &'static StyledProperty<Option<Rc<dyn IControlTemplate>>>
    

    Defines the Template property.

    Source

    is_template_focus_target_property

    fn is_template_focus_target_property() -> &'static AttachedProperty<bool>
    

    Defines the IsTemplateFocusTarget attached property.

    Source

    template_applied_event

    fn template_applied_event() -> &'static RoutedEvent<TemplateAppliedEventArgs>
    

    Defines the TemplateApplied routed event.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    template_applied

    fn template_applied(self: &Self, handler: impl Fn(&Interactive, &TemplateAppliedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Raised when the control's template is applied.

    Source

    background

    fn background(self: &Self) -> Option<Rc<dyn IBrush>>
    

    The brush used to draw the control's background.

    Source

    set_background

    fn set_background(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    background_sizing

    fn background_sizing(self: &Self) -> BackgroundSizing
    

    How the control's background is drawn relative to the control's border.

    Source

    set_background_sizing

    fn set_background_sizing(self: &Self, value: BackgroundSizing)
    

    Source

    border_brush

    fn border_brush(self: &Self) -> Option<Rc<dyn IBrush>>
    

    The brush used to draw the control's border.

    Source

    set_border_brush

    fn set_border_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    border_thickness

    fn border_thickness(self: &Self) -> Thickness
    

    The thickness of the control's border.

    Source

    set_border_thickness

    fn set_border_thickness(self: &Self, value: Thickness)
    

    Source

    corner_radius

    fn corner_radius(self: &Self) -> CornerRadius
    

    The radius of the border rounded corners.

    Source

    set_corner_radius

    fn set_corner_radius(self: &Self, value: CornerRadius)
    

    Source

    font_family

    fn font_family(self: &Self) -> FontFamily
    

    The font family used to draw the control's text.

    Source

    set_font_family

    fn set_font_family(self: &Self, value: FontFamily)
    

    Source

    font_features

    fn font_features(self: &Self) -> Option<FontFeatureCollection>
    

    The font features turned on/off.

    Source

    set_font_features

    fn set_font_features(self: &Self, value: Option<FontFeatureCollection>)
    

    Source

    font_size

    fn font_size(self: &Self) -> f64
    

    The size of the control's text in points.

    Source

    set_font_size

    fn set_font_size(self: &Self, value: f64)
    

    Source

    font_style

    fn font_style(self: &Self) -> FontStyle
    

    The font style used to draw the control's text.

    Source

    set_font_style

    fn set_font_style(self: &Self, value: FontStyle)
    

    Source

    font_weight

    fn font_weight(self: &Self) -> FontWeight
    

    The font weight used to draw the control's text.

    Source

    set_font_weight

    fn set_font_weight(self: &Self, value: FontWeight)
    

    Source

    font_stretch

    fn font_stretch(self: &Self) -> FontStretch
    

    The font stretch used to draw the control's text.

    Source

    set_font_stretch

    fn set_font_stretch(self: &Self, value: FontStretch)
    

    Source

    foreground

    fn foreground(self: &Self) -> Option<Rc<dyn IBrush>>
    

    The brush used to draw the control's text and other foreground elements.

    Source

    set_foreground

    fn set_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    letter_spacing

    fn letter_spacing(self: &Self) -> f64
    

    The letter spacing for the control's text content.

    Source

    set_letter_spacing

    fn set_letter_spacing(self: &Self, value: f64)
    

    Source

    padding

    fn padding(self: &Self) -> Thickness
    

    The padding placed between the border of the control and its content.

    Source

    set_padding

    fn set_padding(self: &Self, value: Thickness)
    

    Source

    template

    fn template(self: &Self) -> Option<Rc<dyn IControlTemplate>>
    

    The template that defines the control's appearance.

    Source

    set_template

    fn set_template(self: &Self, value: Option<Rc<dyn IControlTemplate>>)
    

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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

    Source

    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.

    Source

    Trait implementations

    Availability

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