# ChangePropertyAction

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions/struct-changepropertyaction/

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

```rust
struct ChangePropertyAction
```

An action that will change a specified property to a specified value when invoked.

The property is found by name on the target: a registered property (an attached property is
named `(Owner.Name)`), else a plain property declared in the markup metadata of the type of the
target. Executed reversibly, the action can revert the change (see `IReversibleAction`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L21)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`property_name_property`](#function-property_name_property)
- [`target_object_property`](#function-target_object_property)
- [`value_property`](#function-value_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`property_name`](#function-property_name)
- [`set_property_name`](#function-set_property_name)
- [`value`](#function-value)
- [`set_action_value`](#function-set_action_value)
- [`target_object`](#function-target_object)
- [`set_target_object`](#function-set_target_object)
- [`execute_reversibly`](#function-execute_reversibly)
- [`revert`](#function-revert)

<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/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L31)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L31)

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

### property_name_property

```rust
fn property_name_property() -> &'static StyledProperty<Option<String>>
```

Identifies the `PropertyName` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L42)

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

### target_object_property

```rust
fn target_object_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Identifies the `TargetObject` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L42)

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

### value_property

```rust
fn value_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Identifies the `Value` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L42)

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

### construct

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L94)

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

### new

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

Creates an action.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L105)

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

### property_name

```rust
fn property_name(self: &Self) -> Option<String>
```

Gets or sets the name of the property to change. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L110)

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

### set_property_name

```rust
fn set_property_name(self: &Self, value: Option<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L114)

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

### value

```rust
fn value(self: &Self) -> Option<BoxedValue>
```

Gets or sets the value to set. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L119)

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

### set_action_value

```rust
fn set_action_value(self: &Self, value: Option<BoxedValue>)
```

Sets the value to set (named apart from the setter of every property of the object, as the
condition of the object model names its own).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L125)

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

### target_object

```rust
fn target_object(self: &Self) -> Option<BoxedValue>
```

Gets or sets the object whose property will be changed. If it is not set or cannot be
resolved, the sender of `execute` is used. Markup
resolves a name given for it to the named element. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L132)

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

### set_target_object

```rust
fn set_target_object(self: &Self, value: Option<BoxedValue>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L136)

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

### execute_reversibly

```rust
fn execute_reversibly(self: &Self, sender: Option<&BoxedValue>, _parameter: Option<&BoxedValue>) -> Option<BoxedValue>
```

Executes the action while capturing the state required to revert it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L141)

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

### revert

```rust
fn revert(self: &Self, _sender: Option<&BoxedValue>, _parameter: Option<&BoxedValue>) -> Option<BoxedValue>
```

Reverts the property value captured when this action was first applied.

Returns true if reverting the property value succeeds; else false.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions/core/change_property_action.rs#L241)

## 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/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`StyledElementActionImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementactionimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<ChangePropertyAction>`](/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/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`StyledElementActionImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementactionimpl/)
- [`IAction`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-iaction/)
- [`IReversibleAction`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-ireversibleaction/)

## Availability

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