# ResourceDictionaryOwnership

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/controls/struct-resourcedictionaryownership/

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

```rust
struct ResourceDictionaryOwnership
```

Claims existing entries immediately after XAML population. Retains no resource
values or owners. Later application entries survive replacement; writes to an
owned key (including assigning the same value) relinquish ownership and reject
the reload. Deferred realization itself is not an application write.

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

## Members

- [`capture`](#function-capture)
- [`owns_container`](#function-owns_container)
- [`application_resource`](#function-application_resource)
- [`preview_resource`](#function-preview_resource)
- [`prepare_with_preview`](#function-prepare_with_preview)
- [`prepare`](#function-prepare)

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

### capture

```rust
fn capture(dictionary: &Ref<ResourceDictionary>) -> Self
```



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

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

### owns_container

```rust
fn owns_container(self: &Self, dictionary: &Ref<ResourceDictionary>) -> bool
```



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

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

### application_resource

```rust
fn application_resource(self: &Self, key: &ResourceKey, theme: Option<&ThemeVariant>) -> Option<ResourceValue>
```

Looks up only application contributions for a detached candidate's ambient
context. Does not attach an owner or realize a copy of an application value.

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

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

### preview_resource

```rust
fn preview_resource(self: &Self, candidate: &ResourceDictionary, key: &ResourceKey, theme: Option<&ThemeVariant>) -> Result<Option<ResourceValue>, String>
```

Resolves the composed dictionary without transferring owners. Application
entries remain in place, replacement themes keep per-variant precedence,
and replacement merged providers occupy the original owned range.
Call this throughout candidate population, including deferred factories.

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

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

### prepare_with_preview

```rust
fn prepare_with_preview(self: &Self, candidate: &Ref<ResourceDictionary>) -> Result<ResourceDictionaryChange, String>
```

Prepares replacement when every candidate lookup uses `preview_resource`.
Callers without a composed preview must use `prepare`, which conservatively
rejects provider combinations whose precedence it cannot validate.

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

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

### prepare

```rust
fn prepare(self: &Self, candidate: &Ref<ResourceDictionary>) -> Result<ResourceDictionaryChange, String>
```

Candidate must be detached from its temporary owner before commit.
Commit/rollback operate on framework collections; custom notification
observers must not panic, mutate those collections or perform irreversible work.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`

## Availability

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