CompositionPropertySet CompositionPropertySet CompositionPropertySet CompositionPropertySet Class

Definition

Stores values as key-value pairs. CompositionPropertySet s are CompositionObject s that allow storage of key values pairs that can be shared across the application and are not tied to the lifetime of another composition object. CompositionPropertySet s are most commonly used with animations, where they maintain key-value pairs that are referenced to drive portions of composition animations. CompositionPropertySet s provide the ability to insert key-value pairs or retrieve a value for a given key. For more information on using CompositionPropertySet with animations, see the Animations Overview page.

public : sealed class CompositionPropertySet : CompositionObject, ICompositionPropertySet, ICompositionPropertySet2
struct winrt::Windows::UI::Composition::CompositionPropertySet : CompositionObject, ICompositionPropertySet, ICompositionPropertySet2
public sealed class CompositionPropertySet : CompositionObject, ICompositionPropertySet, ICompositionPropertySet2
Public NotInheritable Class CompositionPropertySet Inherits CompositionObject Implements ICompositionPropertySet, ICompositionPropertySet2
Inheritance
CompositionPropertySetCompositionPropertySetCompositionPropertySetCompositionPropertySet
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples


void CreatePropertySet()
{
  // Create the CompositionPropertySet and insert a scalar value
  CompositionPropertySet sharedPropSet = _compositor.CreatePropertySet();
  sharedPropSet.InsertScalar("offsetChange", 50f);

  // Reference value in CompositionPropertySet in an Expression
  ExpressionAnimation expression =
  _compositor.CreateExpressionAnimation("this.Target.Offset.X + shared.offsetChange");
  expression.SetReferenceParameter("shared", sharedPropSet);
}

void PropertySetRetrieve(CompositionPropertySet propertySet)
{
  // Retrieve the value of key in a CompositionPropertySet
  float tempOffset;
  propertySet.TryGetScalar("offsetChange", out tempOffset);
}

Remarks

CompositionPropertySet does not support a delete function – ensure you use CompositionPropertySet to store values that will be shared across the application.

Note

Inserting a new value into a CompositionPropertySet for a key that already exists with overwrite the old value with the new one.

Methods

Close Close Close Close

Closes the CompositionObject and releases system resources.

(Inherited from CompositionObject)
InsertBoolean(String, Boolean) InsertBoolean(String, Boolean) InsertBoolean(String, Boolean) InsertBoolean(String, Boolean)

Inserts a boolean key-value pair.

InsertColor(String, Color) InsertColor(String, Color) InsertColor(String, Color) InsertColor(String, Color)

Inserts a Color key-value pair.

InsertMatrix3x2(String, Matrix3x2) InsertMatrix3x2(String, Matrix3x2) InsertMatrix3x2(String, Matrix3x2) InsertMatrix3x2(String, Matrix3x2)

Inserts a Matrix3x2 key-value pair.

InsertMatrix4x4(String, Matrix4x4) InsertMatrix4x4(String, Matrix4x4) InsertMatrix4x4(String, Matrix4x4) InsertMatrix4x4(String, Matrix4x4)

Inserts a Matrix4x4 key-value pair.

InsertQuaternion(String, Quaternion) InsertQuaternion(String, Quaternion) InsertQuaternion(String, Quaternion) InsertQuaternion(String, Quaternion)

Inserts a quaternion key-value pair.

InsertScalar(String, Single) InsertScalar(String, Single) InsertScalar(String, Single) InsertScalar(String, Single)

Inserts a Single key-value pair.

InsertVector2(String, Vector2) InsertVector2(String, Vector2) InsertVector2(String, Vector2) InsertVector2(String, Vector2)

Inserts a Vector2 key-value pair.

InsertVector3(String, Vector3) InsertVector3(String, Vector3) InsertVector3(String, Vector3) InsertVector3(String, Vector3)

Inserts a Vector3 key-value pair.

InsertVector4(String, Vector4) InsertVector4(String, Vector4) InsertVector4(String, Vector4) InsertVector4(String, Vector4)

Inserts a Vector4 key-value pair.

PopulatePropertyInfo(String,AnimationPropertyInfo) PopulatePropertyInfo(String,AnimationPropertyInfo) PopulatePropertyInfo(String,AnimationPropertyInfo) PopulatePropertyInfo(String,AnimationPropertyInfo)

Defines a property that can be animated.

(Inherited from CompositionObject)
StartAnimation(String,CompositionAnimation) StartAnimation(String,CompositionAnimation) StartAnimation(String,CompositionAnimation) StartAnimation(String,CompositionAnimation)

Connects an animation with the specified property of the object and starts the animation.

(Inherited from CompositionObject)
StartAnimationGroup(ICompositionAnimationBase) StartAnimationGroup(ICompositionAnimationBase) StartAnimationGroup(ICompositionAnimationBase) StartAnimationGroup(ICompositionAnimationBase)

Starts an animation group.

The StartAnimationGroup method on CompositionObject lets you start CompositionAnimationGroup. All the animations in the group will be started at the same time on the object.

(Inherited from CompositionObject)
StartAnimationGroupWithIAnimationObject(IAnimationObject,ICompositionAnimationBase) StartAnimationGroupWithIAnimationObject(IAnimationObject,ICompositionAnimationBase) StartAnimationGroupWithIAnimationObject(IAnimationObject,ICompositionAnimationBase) StartAnimationGroupWithIAnimationObject(IAnimationObject,ICompositionAnimationBase)

Starts an animation group on the specified target.

(Inherited from CompositionObject)
StartAnimationWithIAnimationObject(IAnimationObject,String,CompositionAnimation) StartAnimationWithIAnimationObject(IAnimationObject,String,CompositionAnimation) StartAnimationWithIAnimationObject(IAnimationObject,String,CompositionAnimation) StartAnimationWithIAnimationObject(IAnimationObject,String,CompositionAnimation)

Connects an animation with the specified property of the target object and starts the animation.

(Inherited from CompositionObject)
StopAnimation(String) StopAnimation(String) StopAnimation(String) StopAnimation(String)

Disconnects an animation from the specified property and stops the animation.

(Inherited from CompositionObject)
StopAnimationGroup(ICompositionAnimationBase) StopAnimationGroup(ICompositionAnimationBase) StopAnimationGroup(ICompositionAnimationBase) StopAnimationGroup(ICompositionAnimationBase)

Stops an animation group.

(Inherited from CompositionObject)
TryGetAnimationController(String) TryGetAnimationController(String) TryGetAnimationController(String) TryGetAnimationController(String)

Returns an AnimationController for the animation running on the specified property.

(Inherited from CompositionObject)
TryGetBoolean(String, Boolean) TryGetBoolean(String, Boolean) TryGetBoolean(String, Boolean) TryGetBoolean(String, Boolean)

Retrieves the specified boolean property value.

TryGetColor(String, Color) TryGetColor(String, Color) TryGetColor(String, Color) TryGetColor(String, Color)

Retrieves the specified Color property value.

TryGetMatrix3x2(String, Matrix3x2) TryGetMatrix3x2(String, Matrix3x2) TryGetMatrix3x2(String, Matrix3x2) TryGetMatrix3x2(String, Matrix3x2)

Retrieves the specified Matrix3x2 property value.

TryGetMatrix4x4(String, Matrix4x4) TryGetMatrix4x4(String, Matrix4x4) TryGetMatrix4x4(String, Matrix4x4) TryGetMatrix4x4(String, Matrix4x4)

Retrieves the specified Matrix4x4 property value.

TryGetQuaternion(String, Quaternion) TryGetQuaternion(String, Quaternion) TryGetQuaternion(String, Quaternion) TryGetQuaternion(String, Quaternion)

Retrieves the specified quaternion property value.

TryGetScalar(String, Single) TryGetScalar(String, Single) TryGetScalar(String, Single) TryGetScalar(String, Single)

Retrieves the specified Single property value.

TryGetVector2(String, Vector2) TryGetVector2(String, Vector2) TryGetVector2(String, Vector2) TryGetVector2(String, Vector2)

Retrieves the specified Vector2 property value.

TryGetVector3(String, Vector3) TryGetVector3(String, Vector3) TryGetVector3(String, Vector3) TryGetVector3(String, Vector3)

Retrieves the specified Vector3 property value.

TryGetVector4(String, Vector4) TryGetVector4(String, Vector4) TryGetVector4(String, Vector4) TryGetVector4(String, Vector4)

Retrieves the specified Vector4 property value.

Properties

Comment Comment Comment Comment

A string to associate with the CompositionObject.

(Inherited from CompositionObject)
Compositor Compositor Compositor Compositor

The Compositor used to create this CompositionObject.

(Inherited from CompositionObject)
Dispatcher Dispatcher Dispatcher Dispatcher

The dispatcher for the CompositionObject.

(Inherited from CompositionObject)
DispatcherQueue DispatcherQueue DispatcherQueue DispatcherQueue

Gets the DispatcherQueue for the CompostionObject.

(Inherited from CompositionObject)
ImplicitAnimations ImplicitAnimations ImplicitAnimations ImplicitAnimations

The collection of implicit animations attached to this object.

(Inherited from CompositionObject)
Properties Properties Properties Properties

The collection of properties associated with the CompositionObject.

(Inherited from CompositionObject)

See also