# DevToolsPage

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-diagnostics/diagnostics/view_models/struct-devtoolspage/

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

```rust
struct DevToolsPage
```

Addition of the port (not in the original): a page that another crate
adds to the developer tools, shown as a tab after the tabs of the
original (the logical tree, the visual tree, the events and the hidden
hot keys tab).

A page is a title and a factory of its view. The factory is called with
the view model of the developer tools window the first time the tab of
the page is selected in that window; the view is kept for the lifetime of
the window. `MainViewModel::root` is the object the window inspects.

```ignore
let registration = MainViewModel::register_page(DevToolsPage::new("Components", |main| {
    ComponentsPageView::new(main.root()).upcast()
}));
// ...
registration.dispose(); // removes the page from the windows opened afterwards
```

Pages are registered per thread (the UI thread), as everything the
developer tools show. A registration applies to the developer tools
windows opened after it.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/main_view_model.rs#L47)

## Members

- [`new`](#function-new)
- [`title`](#function-title)
- [`create_view`](#function-create_view)

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

### new

```rust
fn new(title: impl Into<String>, create_view: impl Fn(&Rc<MainViewModel>) -> Ref<Control> + 'static) -> Self
```

A page with the title of its tab and the factory of its view.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/main_view_model.rs#L54)

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

### title

```rust
fn title(self: &Self) -> &str
```

The title of the tab of the page.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/main_view_model.rs#L59)

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

### create_view

```rust
fn create_view(self: &Self, main_view_model: &Rc<MainViewModel>) -> Ref<Control>
```

Creates the view of the page for the view model of a developer tools
window.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/main_view_model.rs#L65)

## Trait implementations

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

## Availability

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