# RadioButtonAutomationPeer

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/automation/peers/struct-radiobuttonautomationpeer/

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

```rust
struct RadioButtonAutomationPeer
```

An automation peer which represents a [`RadioButton`](/docs/0.5.0/api/ferroui-controls/struct-radiobutton/).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L14)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`raise_toggle_state_property_changed_event`](#function-raise_toggle_state_property_changed_event)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`is_selected`](#function-is_selected)
- [`selection_container`](#function-selection_container)
- [`add_to_selection`](#function-add_to_selection)
- [`remove_from_selection`](#function-remove_from_selection)
- [`select`](#function-select)

<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.Controls/automation/peers/radio_button_automation_peer.rs#L18)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L18)

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

### raise_toggle_state_property_changed_event

```rust
fn raise_toggle_state_property_changed_event(self: &Self, old_value: Option<bool>, new_value: Option<bool>)
```

Raises the property changed event of the selection state for a
change of the checked state of the radio button (not for use
outside the framework).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L18)

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

### construct

```rust
fn construct(owner: &RadioButton) -> Self
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L96)

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

### new

```rust
fn new(owner: &RadioButton) -> Ref<Self>
```

Initializes a new peer of `owner`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L101)

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

### is_selected

```rust
fn is_selected(self: &Self) -> bool
```

Whether the radio button is checked (the selection item provider
contract).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L111)

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

### selection_container

```rust
fn selection_container(self: &Self) -> Option<Rc<dyn ISelectionProvider>>
```

The container of the selection: none (the selection item provider
contract).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L117)

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

### add_to_selection

```rust
fn add_to_selection(self: &Self) -> Result<(), AutomationError>
```

Adds the radio button to the selection (the selection item provider
contract).
## Errors

`AutomationError::InvalidOperation` if the radio button is not
checked.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L128)

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

### remove_from_selection

```rust
fn remove_from_selection(self: &Self) -> Result<(), AutomationError>
```

Removes the radio button from the selection (the selection item
provider contract).
## Errors

`AutomationError::InvalidOperation` if the radio button is
checked.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L142)

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

### select

```rust
fn select(self: &Self) -> Result<(), AutomationError>
```

Checks the radio button (the selection item provider contract).
## Errors

`AutomationError::InvalidOperation` if the radio button is
disabled (the reference throws an `InvalidOperationException`
here, not an `ElementNotEnabledException`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/radio_button_automation_peer.rs#L156)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AutomationPeerImplExt`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-automationpeerimplext/)
- [`ControlAutomationPeerImplExt`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-controlautomationpeerimplext/)
- [`RadioButtonAutomationPeerImplExt`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-radiobuttonautomationpeerimplext/)
- `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<RadioButtonAutomationPeer>`](/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/)
- [`ControlAutomationPeerImpl`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-controlautomationpeerimpl/)
- [`AutomationPeerImpl`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-automationpeerimpl/)
- [`RadioButtonAutomationPeerImpl`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-radiobuttonautomationpeerimpl/)

## Availability

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