# EventsPageViewModel

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

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

```rust
struct EventsPageViewModel
```

The view model of the events page: the tree of the registered routed
events grouped by the type that owns them, whose check boxes choose the
events to record, and the recorded events.

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

## Members

- [`new`](#function-new)
- [`name`](#function-name)
- [`nodes`](#function-nodes)
- [`recorded_events`](#function-recorded_events)
- [`selected_event`](#function-selected_event)
- [`set_selected_event`](#function-set_selected_event)
- [`selected_node`](#function-selected_node)
- [`set_selected_node`](#function-set_selected_node)
- [`nodes_source`](#function-nodes_source)
- [`nodes_source_ref`](#function-nodes_source_ref)
- [`visible_nodes`](#function-visible_nodes)
- [`index_path_of`](#function-index_path_of)
- [`selected_row_index`](#function-selected_row_index)
- [`events_filter`](#function-events_filter)
- [`clear`](#function-clear)
- [`disable_all`](#function-disable_all)
- [`enable_default`](#function-enable_default)
- [`request_tree_navigate_to`](#function-request_tree_navigate_to)
- [`select_event_by_type`](#function-select_event_by_type)
- [`main_view`](#function-main_view)

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

### new

```rust
fn new(main_view_model: Weak<MainViewModel>) -> Rc<Self>
```

C# `new EventsPageViewModel(MainViewModel mainViewModel)`: the tree of
the routed events registered on this thread, with the default events
enabled.

The main view model is held weakly: it holds the page.

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

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

### name

```rust
fn name(self: &Self) -> String
```

The title of the page.

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

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

### nodes

```rust
fn nodes(self: &Self) -> FerroList<Rc<EventTreeNodeBase>>
```

The nodes of the types that own routed events, ordered by the names
of the types.

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

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

### recorded_events

```rust
fn recorded_events(self: &Self) -> FerroList<Rc<FiredEvent>>
```

The recorded events, the oldest first.

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

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

### selected_event

```rust
fn selected_event(self: &Self) -> Option<Rc<FiredEvent>>
```



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

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

### set_selected_event

```rust
fn set_selected_event(self: &Self, value: Option<Rc<FiredEvent>>)
```



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

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

### selected_node

```rust
fn selected_node(self: &Self) -> Option<Rc<EventTreeNodeBase>>
```



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

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

### set_selected_node

```rust
fn set_selected_node(self: &Self, value: Option<Rc<EventTreeNodeBase>>)
```



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

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

### nodes_source

```rust
fn nodes_source(self: &Self) -> Rc<HierarchicalTreeDataGridSource<EventTreeNodeBase>>
```

The source of the TreeDataGrid of the page: the rows of the visible nodes.

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

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

### nodes_source_ref

```rust
fn nodes_source_ref(self: &Self) -> TreeDataGridSourceRef
```

The source of the TreeDataGrid of the page, as the grid takes it.

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

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

### visible_nodes

```rust
fn visible_nodes(self: &Self) -> Rc<FerroList<Rc<EventTreeNodeBase>>>
```

The visible nodes of the owners of events: the root rows of the TreeDataGrid of the page.

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

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

### index_path_of

```rust
fn index_path_of(self: &Self, node: &Rc<EventTreeNodeBase>) -> Option<IndexPath>
```

The index path of the row of a node in the source; `None` when the node is not visible.

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

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

### selected_row_index

```rust
fn selected_row_index(self: &Self) -> i32
```

The index of the row of the selected node among the rows the TreeDataGrid shows; `-1`
when no node is selected or its row is not shown.

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

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

### events_filter

```rust
fn events_filter(self: &Self) -> Rc<FilterViewModel>
```

The filter of the tree of the events.

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

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

### clear

```rust
fn clear(self: &Self)
```

Removes the recorded events.

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

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

### disable_all

```rust
fn disable_all(self: &Self)
```

Stops recording every event.

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

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

### enable_default

```rust
fn enable_default(self: &Self)
```

Records the default events and no other.

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

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

### request_tree_navigate_to

```rust
fn request_tree_navigate_to(self: &Self, nav_target: &EventChainLink)
```

Shows the element of a link of the chain of an event in the visual
tree page.

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

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

### select_event_by_type

```rust
fn select_event_by_type(self: &Self, evt: RoutedEvent)
```

Selects the node of `evt` in the tree, if it is visible.

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

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

### main_view

```rust
fn main_view(self: &Self) -> Option<Rc<MainViewModel>>
```

The main view model the page belongs to.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`TreeModel`](/docs/0.5.0/api/ferroui-treedatagrid-core/accessor/trait-treemodel/)
- `PartialEq`
- [`INotifyPropertyChanged`](/docs/0.5.0/api/ferroui-base/data/model/use-inotifypropertychanged/)
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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