# On

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-markup-xaml/markup_extensions/struct-on/

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

```rust
struct On<TReturn = ferroui_base::BoxedValue>
```

One branch of an option markup extension in element syntax:

```xml
<OnPlatform>
  <On Options="Windows, Linux">..</On>
</OnPlatform>
```

`TReturn` is the type of the value; the non-generic form of the managed
original is `On` with its default type argument (any value).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/markup_extensions/on.rs#L18)

## Members

- [`new`](#function-new)
- [`options`](#function-options)
- [`add_option`](#function-add_option)
- [`content`](#function-content)
- [`set_content`](#function-set_content)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/markup_extensions/on.rs#L24)

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

### options

```rust
fn options(self: &Self) -> Vec<String>
```

The options this branch applies to.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/markup_extensions/on.rs#L29)

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

### add_option

```rust
fn add_option(self: &Self, option: impl Into<String>)
```

Adds an option (the list of the managed original is filled by the
markup compiler).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/markup_extensions/on.rs#L35)

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

### content

```rust
fn content(self: &Self) -> Option<TReturn>
```

The value of the branch.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/markup_extensions/on.rs#L40)

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

### set_content

```rust
fn set_content(self: &Self, value: Option<TReturn>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Markup/FerroUI.Markup.Xaml/markup_extensions/on.rs#L44)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `PartialEq`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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