Skip to main content

ViewLocator

Struct ViewLocator 

Source
pub struct ViewLocator { /* private fields */ }
Expand description

Builds the view of a view model: the class whose full name is the full name of the class of the view model with ViewModel replaced by View.

Implementations§

Source§

impl ViewLocator

Source

pub fn new() -> Rc<ViewLocator>

Source

pub fn as_data_template(&self) -> Rc<dyn IDataTemplate>

The locator as the data template contract.

Trait Implementations§

Source§

impl IDataTemplate for ViewLocator

Source§

fn match_(&self, data: Option<&BoxedValue>) -> bool

Checks to see if this data template matches the specified data.
Source§

fn as_any(&self) -> Option<&dyn Any>

The implementing value, for casting to its concrete type (as_any()?.downcast_ref::<T>()): the equivalent of is/as on the contract. None for an implementation that does not expose itself.
Source§

fn as_recycling_data_template(&self) -> Option<&dyn IRecyclingDataTemplate>

The template viewed as a recycling data template, if it is one.
Source§

fn as_typed_data_template(&self) -> Option<&dyn ITypedDataTemplate>

The template viewed as a typed data template, if it is one.
Source§

fn as_tree_data_template(&self) -> Option<&dyn ITreeDataTemplate>

The template viewed as a tree data template, if it is one.
Source§

impl IRecyclingDataTemplate for ViewLocator

Deviation (DEVIATIONS.md, Developer tools): the locator is a recycling data template. The view it built last for a content is reused for the next view model of the same view, which gets it as its data context, where upstream builds a new view for every view model: the details of a control are a new view model at every selection of a node, and building their view again (the property grid with its columns, rows and editors, the layout, the value frames) made the properties appear a moment after the selection. The views follow their data context.

Source§

fn build_with_existing( &self, data: Option<&BoxedValue>, existing: Option<Ref<Control>>, ) -> Option<Ref<Control>>

Creates or recycles a control to display the specified data. Read more
Source§

impl ITemplateWithParam<Option<Rc<dyn AnyValue>>, Option<Ref<Control>>> for ViewLocator

Source§

fn build(&self, data: &Option<BoxedValue>) -> Option<Ref<Control>>

Creates the control.
Source§

impl MarkupTyped for ViewLocator

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for ViewLocator

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> TreeModel for T
where T: PartialEq + 'static,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.