# MainWindow

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-diagnostics/diagnostics/views/struct-mainwindow/

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

```rust
struct MainWindow
```

The window of the developer tools: the main view over the view model of
the root it inspects, the hot keys that pick the control under the
pointer, freeze the popups, freeze the value frames and take screenshots.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L48)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`DOCUMENT_URI`](#assoc_const-document_uri)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`root`](#function-root)
- [`set_root`](#function-set_root)
- [`set_options`](#function-set_options)
- [`selected_control`](#function-selected_control)

<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.Diagnostics/diagnostics/views/main_window.rs#L60)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L60)

<a id="assoc_const-document_uri"></a>

### DOCUMENT_URI

```rust
const DOCUMENT_URI: &'static str
```

The URI of the document of the class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L110)

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

### construct

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L112)

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

### new

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

Creates the window and populates it from its document
(`InitializeComponent()`: the compiled markup of the document, which
the build of the crate generates), with the theme of a window of the
WinUI 3 theme, the observation of the input and the placement on the
startup screen.
## Panics
Panics when no windowing platform is registered, and when the
document fails to load (an exception of the constructor in the
original).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L134)

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

### root

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

The object the window inspects: a top level, or the application of
the developer tools.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L234)

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

### set_root

```rust
fn set_root(self: &Self, value: Option<Ref<FerroObject>>)
```

Sets the object the window inspects; a root that tells when it is
closed gets a view model and closes the window when it closes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L240)

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

### set_options

```rust
fn set_options(self: &Self, options: &DevToolsOptions)
```

Applies the options the developer tools were opened with: the hot
keys, the options of the view model and the theme variant.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L447)

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

### selected_control

```rust
fn selected_control(self: &Self, control: Option<Ref<Control>>)
```

Selects a control in the tree page of the window.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/views/main_window.rs#L459)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `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`
- [`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/)
- [`TopLevelImplExt`](/docs/0.5.0/api/ferroui-controls/trait-toplevelimplext/)
- [`WindowBaseImplExt`](/docs/0.5.0/api/ferroui-controls/trait-windowbaseimplext/)
- [`WindowImplExt`](/docs/0.5.0/api/ferroui-controls/trait-windowimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<MainWindow>`](/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/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`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/)
- [`WindowBaseImpl`](/docs/0.5.0/api/ferroui-controls/trait-windowbaseimpl/)
- [`WindowImpl`](/docs/0.5.0/api/ferroui-controls/trait-windowimpl/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`TopLevelImpl`](/docs/0.5.0/api/ferroui-controls/trait-toplevelimpl/)

## Availability

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