Skip to main content

InitialValueExpressionCollection

Struct InitialValueExpressionCollection 

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

The initial values of a CompositionAnimation (CompositionAnimation.InitialValueExpressions): a map from the name of a property of the target object ("Offset", "Opacity") to an expression string. When the animation starts, each expression is evaluated against the target object and the parameters of the animation, and the property is set to the result before the animation runs; this.StartingValue and this.CurrentValue in such an expression are the value the property has at that moment.

Implementations§

Source§

impl InitialValueExpressionCollection

Source

pub fn insert(&self, property_name: &str, expression: &str) -> bool

Sets the initial value expression of a property. Returns true when it replaced an expression the property already had.

Source

pub fn lookup(&self, property_name: &str) -> Option<String>

The initial value expression of a property, if it has one.

Source

pub fn has_key(&self, property_name: &str) -> bool

Whether the property has an initial value expression.

Source

pub fn remove(&self, property_name: &str) -> bool

Removes the initial value expression of a property. Returns true when the property had one.

Source

pub fn clear(&self)

Removes every initial value expression.

Source

pub fn size(&self) -> usize

The number of initial value expressions.

Source

pub fn get_view(&self) -> Vec<(String, String)>

The (property name, expression) pairs, ordered by property name.

Source

pub fn parse_all( &self, ) -> Result<Vec<(String, Expression)>, ExpressionParseException>

The expressions parsed, ordered by property name, in the form the starting animation takes them to the server (Send). Fails with the error of the first expression that cannot be parsed.

Source

pub fn evaluate_parsed( expressions: &[(String, Expression)], target: &dyn IExpressionObject, parameters: Option<&dyn IExpressionParameterCollection>, foreign_function_interface: &dyn IExpressionForeignFunctionInterface, ) -> Vec<(String, ExpressionVariant)>

Evaluates parsed initial value expressions for a target object: for each (property name, expression) pair (from parse_all), the value the property starts with. this.StartingValue, this.CurrentValue and this.FinalValue are the value the target has for that property, this.Target is the target and the parameters are those of the animation. A result that is Invalid (an expression that does not evaluate) is left out, so the property keeps its value.

This is the step the start of an animation runs on the server before the animation instance is initialized; writing the values to the properties is left to the caller, which knows the property ids.

Trait Implementations§

Source§

impl Default for InitialValueExpressionCollection

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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.