# SimpleTheme

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-themes-simple/struct-simpletheme/

**struct** · [`ferroui-themes-simple`](/docs/0.5.0/api/ferroui-themes-simple/) · v0.5.0

```rust
struct SimpleTheme
```

The Simple theme: the styles and resources of `SimpleTheme.xaml`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L14)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`DOCUMENT_URI`](#assoc_const-document_uri)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_service_provider`](#function-with_service_provider)
- [`with_parts`](#function-with_parts)
- [`as_style`](#function-as_style)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L18)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<SimpleTheme>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L18)

<a id="assoc_const-document_uri"></a>

### DOCUMENT_URI

```rust
const DOCUMENT_URI: &'static str
```

The URI of the document of the class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L34)

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

### construct

```rust
fn construct() -> Self
```

Field initialisation; see `Styles::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L37)

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

### new

```rust
fn new() -> Ref<Self>
```

Creates the theme.
## Panics
Panics if the documents of the theme fail to load (an exception of
the constructor in the managed original).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L46)

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

### with_service_provider

```rust
fn with_service_provider(sp: Option<Rc<dyn IServiceProvider>>) -> Ref<Self>
```

Creates the theme; `sp` is the parent's service provider.

The full theme: every unit of its compiled markup. A later load of the theme by URI gets the
full theme too, unless the application registered the units it keeps.
## Panics
Panics if the documents of the theme fail to load.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L57)

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

### with_parts

```rust
fn with_parts(sp: Option<Rc<dyn IServiceProvider>>, parts: rt::ThemeParts) -> Ref<Self>
```

Creates the theme from some of the units of its compiled markup (#568, step 3 of
docs/porting/theme-trimming.md); `sp` is the parent's service provider.

`parts` are units of `crate::compiled_xaml::THEME_UNITS`, in canonical order (ascending
indices), with the ambient unit (index 0) first: the table an application's build writes
when it trims its themes (the default; `[package.metadata.ferroui] theme-trimming = false`
turns it off). The theme
applies those units, at the places of the full theme and in its order; a unit that `parts`
leaves out adds nothing. Only the units named are linked into the application.
## Panics
Panics if the documents of the theme fail to load.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L75)

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

### as_style

```rust
fn as_style(self: &Self) -> Rc<dyn IStyle>
```

The theme as a style, for the style collections of applications and
elements (`application.styles().add(theme.as_style())`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Simple/simple_theme.rs#L102)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<SimpleTheme>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)

## Availability

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