# FramePage

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

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

```rust
struct FramePage
```

A page a [`Frame`](/docs/0.5.0/api/ferroui-controls/struct-frame/) navigates to (WinUI's `Page`, a `UserControl`).

The name keeps `Page` for the upstream page of `ferroui-controls` ([`crate::Page`](/docs/0.5.0/api/ferroui-controls/page/struct-page/), a templated
control with asynchronous navigation); the two navigation models are separate
(docs/porting/winui-controls.md, section 7). A derived page overrides the callbacks of
[`FramePageImpl`](/docs/0.5.0/api/ferroui-controls/trait-framepageimpl/) (`on_navigated_to`, `on_navigating_from`, `on_navigated_from`), which the frame
calls synchronously. The page is styled as a `UserControl` (WinUI's `Page` has no style of its
own).

Missing (docs/porting/winui-controls.md, section 10.4): `TopAppBar`, `BottomAppBar` and the
navigation transitions of the page.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L32)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`on_navigating_from`](#function-on_navigating_from)
- [`on_navigated_from`](#function-on_navigated_from)
- [`on_navigated_to`](#function-on_navigated_to)
- [`navigation_cache_mode_property`](#function-navigation_cache_mode_property)
- [`frame_property`](#function-frame_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`navigation_cache_mode`](#function-navigation_cache_mode)
- [`set_navigation_cache_mode`](#function-set_navigation_cache_mode)
- [`frame`](#function-frame)

<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.Controls/frame_page.rs#L38)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L38)

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

### on_navigating_from

```rust
fn on_navigating_from(self: &Self, args: &NavigatingCancelEventArgs)
```

Called before the frame navigates away from the page (WinUI's `OnNavigatingFrom`);
`args.set_cancel(true)` cancels the navigation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L38)

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

### on_navigated_from

```rust
fn on_navigated_from(self: &Self, args: &NavigationEventArgs)
```

Called after the frame navigated away from the page (WinUI's `OnNavigatedFrom`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L38)

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

### on_navigated_to

```rust
fn on_navigated_to(self: &Self, args: &NavigationEventArgs)
```

Called after the frame navigated to the page (WinUI's `OnNavigatedTo`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L38)

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

### navigation_cache_mode_property

```rust
fn navigation_cache_mode_property() -> &'static StyledProperty<NavigationCacheMode>
```

Defines the `NavigationCacheMode` property: whether the frame keeps the page to show it
again. `Disabled` by default.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L82)

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

### frame_property

```rust
fn frame_property() -> &'static DirectProperty<FramePage, Option<Ref<Frame>>>
```

Defines the `Frame` property: the frame that shows the page (read-only).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L82)

<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/FerroUI.Controls/frame_page.rs#L98)

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

### new

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

Creates a page.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L103)

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

### navigation_cache_mode

```rust
fn navigation_cache_mode(self: &Self) -> NavigationCacheMode
```

Gets whether the frame keeps the page to show it again.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L108)

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

### set_navigation_cache_mode

```rust
fn set_navigation_cache_mode(self: &Self, mode: NavigationCacheMode)
```

Sets whether the frame keeps the page to show it again.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L113)

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

### frame

```rust
fn frame(self: &Self) -> Option<Ref<Frame>>
```

Gets the frame that shows the page, held weakly, so that a page in the content or the cache
of a frame keeps no cycle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/frame_page.rs#L119)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ContentControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-contentcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`FramePageImplExt`](/docs/0.5.0/api/ferroui-controls/trait-framepageimplext/)
- `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`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`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/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<FramePage>`](/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/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`ContentControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-contentcontrolimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`FramePageImpl`](/docs/0.5.0/api/ferroui-controls/trait-framepageimpl/)

## Availability

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