# TreePageViewModel

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

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

```rust
struct TreePageViewModel
```

The page of a tree of the developer tools (the logical or the visual
tree): the root nodes, the selected node and the details of its control,
and the commands of the context menu of the tree.

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

## Members

- [`new`](#function-new)
- [`with_weak_main_view`](#function-with_weak_main_view)
- [`clipboard_copy_requested`](#function-clipboard_copy_requested)
- [`main_view`](#function-main_view)
- [`properties_filter`](#function-properties_filter)
- [`setters_filter`](#function-setters_filter)
- [`nodes`](#function-nodes)
- [`set_nodes`](#function-set_nodes)
- [`nodes_source`](#function-nodes_source)
- [`nodes_source_ref`](#function-nodes_source_ref)
- [`index_path_of`](#function-index_path_of)
- [`selected_row_index`](#function-selected_row_index)
- [`selected_node`](#function-selected_node)
- [`set_selected_node`](#function-set_selected_node)
- [`details`](#function-details)
- [`dispose`](#function-dispose)
- [`find_node`](#function-find_node)
- [`select_control`](#function-select_control)
- [`copy_selector`](#function-copy_selector)
- [`copy_selector_from_template_parent`](#function-copy_selector_from_template_parent)
- [`expand_recursively`](#function-expand_recursively)
- [`collapse_children`](#function-collapse_children)
- [`capture_node_screenshot`](#function-capture_node_screenshot)
- [`bring_into_view`](#function-bring_into_view)
- [`focus`](#function-focus)
- [`update_properties_view`](#function-update_properties_view)

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

### new

```rust
fn new(main_view: &Rc<MainViewModel>, nodes: Vec<Rc<TreeNode>>, pinned_properties: Rc<RefCell<HashSet<String>>>) -> Rc<Self>
```

`TreePageViewModel(MainViewModel mainView, TreeNode[] nodes, ISet<string> pinnedProperties)`.

The main view model owns its pages, so a page refers to it weakly.
`pinned_properties` is the set of the pinned properties that the
pages share.

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

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

### with_weak_main_view

```rust
fn with_weak_main_view(main_view: Weak<MainViewModel>, nodes: Vec<Rc<TreeNode>>, pinned_properties: Rc<RefCell<HashSet<String>>>) -> Rc<Self>
```

The constructor with the main view model given by a weak reference,
which may be empty: a page without a main view shows the implemented
interfaces and takes no screenshots.

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

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

### clipboard_copy_requested

```rust
fn clipboard_copy_requested(self: &Self, handler: impl Fn(&str) -> () + 'static) -> Rc<dyn IDisposable>
```

`ClipboardCopyRequested`: raised with a selector to copy to the
clipboard. Disposing the returned handle removes the handler.

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

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

### main_view

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

The main view model; `None` once it is gone.

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

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

### properties_filter

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



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

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

### setters_filter

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



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

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

### nodes

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

The root nodes of the tree.

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

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

### set_nodes

```rust
fn set_nodes(self: &Self, value: Vec<Rc<TreeNode>>)
```

`protected set` of `Nodes`.

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

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

### nodes_source

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

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

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

<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/tree_page_view_model.rs#L231)

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

### index_path_of

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

The index path of the row of a node in the source: the index of each of its ancestors
among the children of its parent, from the root node down to the node; `None` when the
node is not in the trees of the page.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Diagnostics/diagnostics/view_models/tree_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/tree_page_view_model.rs#L264)

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

### selected_node

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



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

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

### set_selected_node

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

Selects a node, and shows the details of its object.

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

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

### details

```rust
fn details(self: &Self) -> Option<Rc<ControlDetailsViewModel>>
```

The details of the object of the selected node.

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

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

### dispose

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

`Dispose()`: disposes the nodes and the details.

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

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

### find_node

```rust
fn find_node(self: &Self, control: &Ref<Control>) -> Option<Rc<TreeNode>>
```

The node of `control`, searched in the trees of the root nodes.

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

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

### select_control

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

Selects the node of `control`, or of its nearest visual ancestor that
has one, and expands its ancestors.

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

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

### copy_selector

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

Requests the copy of the selector of the selected control.

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

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

### copy_selector_from_template_parent

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

Requests the copy of the selector of the selected control from the
outermost templated parent, through the templates.

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

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

### expand_recursively

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

Expands the selected node, its ancestors and all its descendants.

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

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

### collapse_children

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

Collapses the selected node and all its descendants.

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

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

### capture_node_screenshot

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

Takes a screenshot of the selected control.

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

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

### bring_into_view

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

Brings the selected control into view.

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

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

### focus

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

Focuses the selected control.

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

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

### update_properties_view

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

Updates the properties of the details with the current setting of
the main view (shown with the implemented interfaces when there is
no main view).

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

## 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/).
