# IRoutedEventArgs

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

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

```rust
trait IRoutedEventArgs: Any
```

Implemented by every routed event args type.

Routed event args form a small class hierarchy rooted at
[`RoutedEventArgs`](/docs/0.5.0/api/ferroui-base/interactivity/struct-routedeventargs/): a derived args type embeds its base as its first
field (named `base`) and derefs to it. This trait gives the runtime view
of that hierarchy, so that an event raised with derived args can be
delivered to a handler written against any of its base args types.

Implement it with `ferro_routed_event_args!`.

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

## Members

- [`as_routed_event_args`](#function-as_routed_event_args)
- [`query_args`](#function-query_args)
- [`is_args_type`](#function-is_args_type)
- [`share`](#function-share)

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

### as_routed_event_args

```rust
fn as_routed_event_args(self: &Self) -> &RoutedEventArgs
```

The base routed event args: the routing state of the event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_args.rs#L19)

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

### query_args

```rust
fn query_args(self: &Self, type_id: TypeId) -> Option<&dyn Any>
```

Returns the args viewed as the args type identified by `type_id`, if
the args are of that type or of a type derived from it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_args.rs#L23)

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

### is_args_type

```rust
fn is_args_type(type_id: TypeId) -> bool
where Self: Sized
```

Whether this args type is the args type identified by `type_id` or is
derived from it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_args.rs#L27)

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

### share

```rust
fn share(self: &Self) -> Rc<dyn IRoutedEventArgs>
```

A shared handle to these args: what untyped code (a handler wired up
by markup) is given, since a borrow cannot be held in an untyped
value. The handle refers to the live args: the state handlers change
(`handled`, the source, a cancel flag, ..) is shared with them.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/interactivity/routed_event_args.rs#L35)

## Trait implementations

- [`IRoutedEventArgs`](/docs/0.5.0/api/ferroui-base/interactivity/trait-iroutedeventargs/)

## Availability

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