# ThemeShadow

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/struct-themeshadow/

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

```rust
struct ThemeShadow
```

The shadow of the theme (WinUI `Microsoft.UI.Xaml.Media.ThemeShadow`): set
as the `Shadow` of an element, the element casts the shadow of its
elevation, the Z of its `Translation`, as the controls of WinUI do under
their popups (32 for a flyout, 16 for a tool tip, 128 for a content
dialog).

WinUI 3 draws every theme shadow as a drop shadow
(`is_drop_shadow_mode`): an ambient and a
directional shadow around the element, the darker in the dark theme,
none in a high contrast theme. A `ThemeShadow` can be shared by several
elements; it has no appearance of its own.

`receivers` are the elements the projected shadows of
WinUI (the root and the open popups by default) would fall on. WinUI 3
keeps the collection and its validation but does not draw projected
shadows, so the receivers do not change the drawing here either.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L59)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`is_drop_shadow_mode`](#function-is_drop_shadow_mode)
- [`receivers`](#function-receivers)
- [`has_custom_receivers`](#function-has_custom_receivers)
- [`mask`](#function-mask)
- [`set_mask`](#function-set_mask)

<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.Base/media/theme_shadow.rs#L67)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L67)

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

### construct

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

Creates the class data.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L73)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L81)

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

### is_drop_shadow_mode

```rust
fn is_drop_shadow_mode() -> bool
```

`ThemeShadow.IsDropShadowMode`: whether theme shadows are drawn as drop
shadows around their casters (`true` in WinUI 3, whose projected
shadows are disabled: `CThemeShadow::IsDropShadowMode`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L88)

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

### receivers

```rust
fn receivers(self: &Self) -> &UIElementWeakCollection
```

`ThemeShadow.Receivers`: the elements the shadow is cast on in the
projected mode. An ancestor of an element that casts the shadow
cannot be a receiver.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L95)

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

### has_custom_receivers

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

Whether the receivers were set (WinUI's `HasCustomReceivers`): the
projected mode casts the shadow on the root and the popups otherwise.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L101)

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

### mask

```rust
fn mask(self: &Self) -> Option<Rc<CompositionBrush>>
```

The mask of the shadow (internal in WinUI, set by the connected
animations for the projected shadows).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L107)

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

### set_mask

```rust
fn set_mask(self: &Self, value: Option<Rc<CompositionBrush>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/theme_shadow.rs#L111)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `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`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<ThemeShadow>`](/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/)

## Availability

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