# StyledElementImpl

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/trait-styledelementimpl/

**trait** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
trait StyledElementImpl: FerroObjectImpl + $crate::Upcast<StyledElement>
```

The overridable members introduced by the class.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

## Members

- [`begin_init`](#function-begin_init)
- [`try_end_init`](#function-try_end_init)
- [`logical_children_collection_changed`](#function-logical_children_collection_changed)
- [`on_attached_to_logical_tree`](#function-on_attached_to_logical_tree)
- [`on_detached_from_logical_tree`](#function-on_detached_from_logical_tree)
- [`on_data_context_changed`](#function-on_data_context_changed)
- [`on_data_context_begin_update`](#function-on_data_context_begin_update)
- [`on_data_context_end_update`](#function-on_data_context_end_update)
- [`on_initialized`](#function-on_initialized)
- [`style_key_override`](#function-style_key_override)
- [`on_control_theme_changed`](#function-on_control_theme_changed)
- [`on_templated_parent_control_theme_changed`](#function-on_templated_parent_control_theme_changed)
- [`invalidate_styles`](#function-invalidate_styles)
- [`is_logical_root`](#function-is_logical_root)
- [`styling_parent`](#function-styling_parent)
- [`notify_child_resources_changed`](#function-notify_child_resources_changed)
- [`child_index_provider`](#function-child_index_provider)
- [`is_theme_variant_root`](#function-is_theme_variant_root)

<a id="function-begin_init"></a>

### begin_init

```rust
fn begin_init(this: &Self)
```

Signals the beginning of a batch of initialization: styling is
deferred until the matching `end_init`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-try_end_init"></a>

### try_end_init

```rust
fn try_end_init(this: &Self) -> Result<(), InitializationError>
```

Signals the end of a batch of initialization: the element is
styled (if it is attached to a rooted logical tree) and
initialized. A style or control theme that cannot be applied (two
setters for the same property) is an error, the counterpart of
the invalid operation `EndInit` raises in the managed original;
what follows the failure is skipped. This is the overridable
member; `end_init` is the form that
panics on the error.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-logical_children_collection_changed"></a>

### logical_children_collection_changed

```rust
fn logical_children_collection_changed(this: &Self, e: &NotifyCollectionChangedEventArgs<'_, Ref<StyledElement>>)
```

Called when the logical children collection changes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-on_attached_to_logical_tree"></a>

### on_attached_to_logical_tree

```rust
fn on_attached_to_logical_tree(this: &Self, e: &LogicalTreeAttachmentEventArgs)
```

Called when the styled element is added to a rooted logical tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-on_detached_from_logical_tree"></a>

### on_detached_from_logical_tree

```rust
fn on_detached_from_logical_tree(this: &Self, e: &LogicalTreeAttachmentEventArgs)
```

Called when the styled element is removed from a rooted logical tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-on_data_context_changed"></a>

### on_data_context_changed

```rust
fn on_data_context_changed(this: &Self)
```

Called when the data context changes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-on_data_context_begin_update"></a>

### on_data_context_begin_update

```rust
fn on_data_context_begin_update(this: &Self)
```

Called when the data context begins updating.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-on_data_context_end_update"></a>

### on_data_context_end_update

```rust
fn on_data_context_end_update(this: &Self)
```

Called when the data context finishes updating.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-on_initialized"></a>

### on_initialized

```rust
fn on_initialized(this: &Self)
```

Called when the control finishes initialization.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-style_key_override"></a>

### style_key_override

```rust
fn style_key_override(this: &Self) -> &'static TypeInfo
```

The type by which the element is styled. Defaults to the element's
own type; override to be styled as a base class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-on_control_theme_changed"></a>

### on_control_theme_changed

```rust
fn on_control_theme_changed(this: &Self)
```

Called when the control theme changes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-on_templated_parent_control_theme_changed"></a>

### on_templated_parent_control_theme_changed

```rust
fn on_templated_parent_control_theme_changed(this: &Self)
```

Called when the templated parent's control theme changes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-invalidate_styles"></a>

### invalidate_styles

```rust
fn invalidate_styles(this: &Self, recurse: bool)
```

Detaches all styles from the element (and optionally from its
inheritance children) so that they are re-applied.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-is_logical_root"></a>

### is_logical_root

```rust
fn is_logical_root(this: &Self) -> bool
```

Whether the element is the root of a logical tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-styling_parent"></a>

### styling_parent

```rust
fn styling_parent(this: &Self) -> Option<StyleHostRef>
```

The parent style host of the element: by default the inheritance
parent, when it is a styled element. The root of a tree overrides
this to return the host of the global styles.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-notify_child_resources_changed"></a>

### notify_child_resources_changed

```rust
fn notify_child_resources_changed(this: &Self, e: ResourcesChangedEventArgs)
```

Notifies the children of the element that the resources visible to
them have changed. The base method notifies the logical children.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-child_index_provider"></a>

### child_index_provider

```rust
fn child_index_provider(this: &Self) -> Option<Rc<dyn IChildIndexProvider>>
```

The child index provider implemented by the element, if any. Used
to match the children of the element by their position.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

<a id="function-is_theme_variant_root"></a>

### is_theme_variant_root

```rust
fn is_theme_variant_root(this: &Self) -> bool
```

Whether the element is a root of theme variant resolution: at a
root the default theme variant resolves to the variant of the
platform instead of being inherited.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styled_element.rs#L71)

## Trait implementations

- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
