# IResourceProvider

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/controls/trait-iresourceprovider/

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

```rust
trait IResourceProvider: IResourceNode
```

Represents an object that can be queried for resources but does not appear
in the logical tree.

The interface represented by this trait is implemented by resource
dictionaries, styles and the like.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L12)

## Members

- [`as_resource_dictionary`](#function-as_resource_dictionary)
- [`as_any`](#function-as_any)
- [`owner`](#function-owner)
- [`owner_changed`](#function-owner_changed)
- [`add_owner`](#function-add_owner)
- [`remove_owner`](#function-remove_owner)
- [`development_source`](#function-development_source)
- [`as_object`](#function-as_object)

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

### as_resource_dictionary

```rust
fn as_resource_dictionary(self: &Self) -> Option<&dyn IResourceDictionary>
```

Views this provider through its dictionary contract when it implements one.
Plain providers return `None`; dictionaries return their actual interface.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L15)

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

### as_any

```rust
fn as_any(self: &Self) -> Option<&dyn Any>
```

The provider as `Any`, for a downcast to its concrete type (the type test of
the managed original). `None` from a provider that does not offer it; the
providers of the framework return themselves.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L22)

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

### owner

```rust
fn owner(self: &Self) -> Option<ResourceHostRef>
```

The owner of the resource provider.

If the resource provider is, or is a child of, a resource dictionary or
style that is hosted by an element, this is that element.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L30)

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

### owner_changed

```rust
fn owner_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
```

Raised when the owner of the resource provider changes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L33)

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

### add_owner

```rust
fn add_owner(self: &Self, owner: &ResourceHostRef)
```

Adds an owner to the resource provider.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L36)

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

### remove_owner

```rust
fn remove_owner(self: &Self, owner: &ResourceHostRef)
```

Removes a resource provider owner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L39)

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

### development_source

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

Canonical source of a development markup include, without loading it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L43)

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

### as_object

```rust
fn as_object(self: &Self) -> Option<&FerroObject>
```

The provider as an object, when it is a class instance. Used for
identity comparison and type tests.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/i_resource_provider.rs#L49)

## Availability

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