Skip to main content

ElementComposition

Struct ElementComposition 

Source
pub struct ElementComposition;
Expand description

Access to the composition visuals of the visuals of the visual tree.

Implementations§

Source§

impl ElementComposition

Source

pub fn get_element_visual(visual: &Visual) -> Option<Rc<CompositionVisual>>

Gets the composition visual of a visual; None while the visual is not attached to a compositor.

Source

pub fn set_element_child_visual( visual: &Visual, composition_visual: Option<Rc<CompositionVisual>>, )

Sets a composition visual that is shown as the last child of the composition visual of visual.

Source

pub fn get_element_child_visual( visual: &Visual, ) -> Option<Rc<CompositionVisual>>

Gets the composition visual set with set_element_child_visual.

Source

pub fn set_implicit_show_animation( visual: &Visual, animation: Option<Rc<dyn ICompositionAnimationBase>>, )

ElementCompositionPreview.SetImplicitShowAnimation: the animation, or the group of animations, started on the composition visual of visual when the visual is added to a visual tree or its IsVisible becomes true. Every animation needs its Target.

Source

pub fn get_implicit_show_animation( visual: &Visual, ) -> Option<Rc<dyn ICompositionAnimationBase>>

The animation of set_implicit_show_animation.

Source

pub fn set_implicit_hide_animation( visual: &Visual, animation: Option<Rc<dyn ICompositionAnimationBase>>, )

ElementCompositionPreview.SetImplicitHideAnimation: the animation, or the group of animations, started on the composition visual of visual when its IsVisible becomes false or the visual is removed from its visual tree. The visual stays visible until the animations complete. Every animation needs its Target.

A visual removed from its tree loses its composition visual at once, so the hide animation of a removal runs on an image of the visual taken when it is removed (WinUI keeps the element itself in its unloading storage until the animation completes).

Source

pub fn get_implicit_hide_animation( visual: &Visual, ) -> Option<Rc<dyn ICompositionAnimationBase>>

The animation of set_implicit_hide_animation.

Source

pub fn set_is_translation_enabled(visual: &Visual, value: bool)

ElementCompositionPreview.SetIsTranslationEnabled. Every composition visual has a Translation property applied after its other transforms, so translation is always enabled; the request is recorded and changes nothing else.

Source

pub fn is_translation_enabled(visual: &Visual) -> bool

Whether set_is_translation_enabled was called with true for visual.

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> 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, 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.