Skip to main content

ControlViewFor

Struct ControlViewFor 

Source
pub struct ControlViewFor<V: IControlViewFor> { /* private fields */ }
Expand description

A control of a class that implements IControlViewFor, as a view of ReactiveUI (IViewFor<TViewModel> on the control).

Implementations§

Source§

impl<V: IControlViewFor> ControlViewFor<V>

Source

pub fn new(control: Ref<V>) -> Rc<Self>

The view of control, which it keeps alive.

Source

pub fn weak(control: &Ref<V>) -> Rc<Self>

The view of control, which it does not keep alive.

Source

pub fn control(&self) -> Option<Ref<V>>

The control, while it is alive.

Source

pub fn into_view_for_of(self: Rc<Self>) -> Rc<dyn IViewForOf<V::ViewModel>>

The view as IViewFor<TViewModel>.

Trait Implementations§

Source§

impl<V: IControlViewFor> IActivatableView for ControlViewFor<V>

Source§

fn as_view_for(&self) -> Option<&dyn IViewFor>

The view as an IViewFor, when it is one (view as IViewFor); None by default.
Source§

fn as_notify_property_changed( self: Rc<Self>, ) -> Option<Rc<dyn INotifyPropertyChanged>>

The change notification of the view, when it raises PropertyChanged (view as INotifyPropertyChanged); None by default. The property observation of the view’s ViewModel uses it.
Source§

fn as_can_activate(&self) -> Option<&dyn ICanActivate>

The view as an ICanActivate, when it is one (view as ICanActivate); None by default. CanActivateViewFetcher uses it.
Source§

impl<V: IControlViewFor> IViewControl for ControlViewFor<V>

Source§

fn view_control(&self) -> Option<Ref<Control>>

The control behind the view, while it is alive.
Source§

impl<V: IControlViewFor> IViewFor for ControlViewFor<V>

Source§

fn view_model(&self) -> Option<Rc<dyn Any>>

The view model displayed by the view (the getter of ViewModel).
Source§

fn set_view_model(&self, view_model: Option<Rc<dyn Any>>)

Sets the view model displayed by the view (the setter of ViewModel). A typed view panics when view_model is of another type than its own, as the cast of upstream’s views throws.
Source§

fn as_view_for_of(self: Rc<Self>) -> Option<Box<dyn Any>>

The view as an Rc<dyn IViewForOf<VM>> in a Box<dyn Any>, for the type VM of view model it is typed for, or None for a view that names no type. Read more
Source§

impl<V: IControlViewFor> IViewForOf<<V as IControlViewFor>::ViewModel> for ControlViewFor<V>

Source§

fn view_model(&self) -> Option<Rc<V::ViewModel>>

The view model displayed by the view (the getter of ViewModel).
Source§

fn set_view_model(&self, view_model: Option<Rc<V::ViewModel>>)

Sets the view model displayed by the view (the setter of ViewModel).

Auto Trait Implementations§

§

impl<V> !RefUnwindSafe for ControlViewFor<V>

§

impl<V> !Send for ControlViewFor<V>

§

impl<V> !Sync for ControlViewFor<V>

§

impl<V> !UnwindSafe for ControlViewFor<V>

§

impl<V> Freeze for ControlViewFor<V>
where ViewLink<V>: Freeze,

§

impl<V> Unpin for ControlViewFor<V>
where ViewLink<V>: Unpin,

§

impl<V> UnsafeUnpin for ControlViewFor<V>

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> 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<V> IntoViewFor for V
where V: IViewFor,

Source§

fn into_view_for(self: Rc<V>) -> Rc<dyn IViewFor>

The view as an Rc<dyn IViewFor>.
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.