pub struct TreePageViewModel { /* private fields */ }Expand description
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.
Implementations§
Source§impl TreePageViewModel
impl TreePageViewModel
Sourcepub fn new(
main_view: &Rc<MainViewModel>,
nodes: Vec<Rc<TreeNode>>,
pinned_properties: Rc<RefCell<HashSet<String>>>,
) -> Rc<Self>
pub 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.
Sourcepub fn with_weak_main_view(
main_view: Weak<MainViewModel>,
nodes: Vec<Rc<TreeNode>>,
pinned_properties: Rc<RefCell<HashSet<String>>>,
) -> Rc<Self>
pub 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.
Sourcepub fn clipboard_copy_requested(
&self,
handler: impl Fn(&str) + 'static,
) -> Rc<dyn IDisposable>
pub fn clipboard_copy_requested( &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.
Sourcepub fn main_view(&self) -> Option<Rc<MainViewModel>>
pub fn main_view(&self) -> Option<Rc<MainViewModel>>
The main view model; None once it is gone.
pub fn properties_filter(&self) -> Rc<FilterViewModel>
pub fn setters_filter(&self) -> Rc<FilterViewModel>
Sourcepub fn nodes_source(&self) -> Rc<HierarchicalTreeDataGridSource<TreeNode>>
pub fn nodes_source(&self) -> Rc<HierarchicalTreeDataGridSource<TreeNode>>
The source of the TreeDataGrid of the page: the rows of the nodes.
Sourcepub fn nodes_source_ref(&self) -> TreeDataGridSourceRef
pub fn nodes_source_ref(&self) -> TreeDataGridSourceRef
The source of the TreeDataGrid of the page, as the grid takes it.
Sourcepub fn index_path_of(&self, node: &Rc<TreeNode>) -> Option<IndexPath>
pub fn index_path_of(&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.
Sourcepub fn selected_row_index(&self) -> i32
pub fn selected_row_index(&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.
pub fn selected_node(&self) -> Option<Rc<TreeNode>>
Sourcepub fn set_selected_node(&self, value: Option<Rc<TreeNode>>)
pub fn set_selected_node(&self, value: Option<Rc<TreeNode>>)
Selects a node, and shows the details of its object.
Sourcepub fn details(&self) -> Option<Rc<ControlDetailsViewModel>>
pub fn details(&self) -> Option<Rc<ControlDetailsViewModel>>
The details of the object of the selected node.
Sourcepub fn find_node(&self, control: &Ref<Control>) -> Option<Rc<TreeNode>>
pub fn find_node(&self, control: &Ref<Control>) -> Option<Rc<TreeNode>>
The node of control, searched in the trees of the root nodes.
Sourcepub fn select_control(&self, control: &Ref<Control>)
pub fn select_control(&self, control: &Ref<Control>)
Selects the node of control, or of its nearest visual ancestor that
has one, and expands its ancestors.
Sourcepub fn copy_selector(&self)
pub fn copy_selector(&self)
Requests the copy of the selector of the selected control.
Sourcepub fn copy_selector_from_template_parent(&self)
pub fn copy_selector_from_template_parent(&self)
Requests the copy of the selector of the selected control from the outermost templated parent, through the templates.
Sourcepub fn expand_recursively(&self)
pub fn expand_recursively(&self)
Expands the selected node, its ancestors and all its descendants.
Sourcepub fn collapse_children(&self)
pub fn collapse_children(&self)
Collapses the selected node and all its descendants.
Sourcepub fn capture_node_screenshot(&self)
pub fn capture_node_screenshot(&self)
Takes a screenshot of the selected control.
Sourcepub fn bring_into_view(&self)
pub fn bring_into_view(&self)
Brings the selected control into view.
Sourcepub fn update_properties_view(&self)
pub fn update_properties_view(&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).
Trait Implementations§
Source§impl INotifyPropertyChanged for TreePageViewModel
impl INotifyPropertyChanged for TreePageViewModel
Source§fn property_changed(&self) -> &Event<str>
fn property_changed(&self) -> &Event<str>
Source§fn as_notify_property_changing(&self) -> Option<&dyn INotifyPropertyChanging>
fn as_notify_property_changing(&self) -> Option<&dyn INotifyPropertyChanging>
INotifyPropertyChanging, when it also raises the event of a property
that is about to change; None by default. Read moreSource§impl MarkupTyped for TreePageViewModel
impl MarkupTyped for TreePageViewModel
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !Freeze for TreePageViewModel
impl !RefUnwindSafe for TreePageViewModel
impl !Send for TreePageViewModel
impl !Sync for TreePageViewModel
impl !UnwindSafe for TreePageViewModel
impl Unpin for TreePageViewModel
impl UnsafeUnpin for TreePageViewModel
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more