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, ICompositionPropertySet2public sealed class CompositionPropertySet : CompositionObject, ICompositionPropertySet, ICompositionPropertySet2Public NotInheritable Class CompositionPropertySet Inherits CompositionObject Implements ICompositionPropertySet, ICompositionPropertySet2// This API is not available in Javascript.
- Inheritance
-
CompositionPropertySetCompositionPropertySetCompositionPropertySetCompositionPropertySet
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
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
InsertBoolean(String, Boolean) InsertBoolean(String, Boolean) InsertBoolean(String, Boolean) InsertBoolean(String, Boolean)
Inserts a boolean key-value pair.
public : void InsertBoolean(PlatForm::String propertyName, bool value)public void InsertBoolean(String propertyName, Boolean value)Public Function InsertBoolean(propertyName As String, value As Boolean) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The key associated with the value. This key can be used to retrieve the value.
- value
- bool Boolean Boolean Boolean
The value to insert.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
InsertColor(String, Color) InsertColor(String, Color) InsertColor(String, Color) InsertColor(String, Color)
Inserts a Color key-value pair.
public : void InsertColor(PlatForm::String propertyName, Color value)public void InsertColor(String propertyName, Color value)Public Function InsertColor(propertyName As String, value As Color) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The key associated with the value. This key can be used to retrieve the value.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
InsertMatrix3x2(String, Matrix3x2) InsertMatrix3x2(String, Matrix3x2) InsertMatrix3x2(String, Matrix3x2) InsertMatrix3x2(String, Matrix3x2)
Inserts a Matrix3x2 key-value pair.
public : void InsertMatrix3x2(PlatForm::String propertyName, Matrix3x2 value)public void InsertMatrix3x2(String propertyName, Matrix3x2 value)Public Function InsertMatrix3x2(propertyName As String, value As Matrix3x2) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The key associated with the value. This key can be used to retrieve the value.
- value
- Matrix3x2 Matrix3x2 Matrix3x2 Matrix3x2
The value to insert.
InsertMatrix4x4(String, Matrix4x4) InsertMatrix4x4(String, Matrix4x4) InsertMatrix4x4(String, Matrix4x4) InsertMatrix4x4(String, Matrix4x4)
Inserts a Matrix4x4 key-value pair.
public : void InsertMatrix4x4(PlatForm::String propertyName, Matrix4x4 value)public void InsertMatrix4x4(String propertyName, Matrix4x4 value)Public Function InsertMatrix4x4(propertyName As String, value As Matrix4x4) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The key associated with the value. This key can be used to retrieve the value.
- value
- Matrix4x4 Matrix4x4 Matrix4x4 Matrix4x4
The value to insert.
InsertQuaternion(String, Quaternion) InsertQuaternion(String, Quaternion) InsertQuaternion(String, Quaternion) InsertQuaternion(String, Quaternion)
Inserts a quaternion key-value pair.
public : void InsertQuaternion(PlatForm::String propertyName, Quaternion value)public void InsertQuaternion(String propertyName, Quaternion value)Public Function InsertQuaternion(propertyName As String, value As Quaternion) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The key associated with the value. This key can be used to retrieve the value.
- value
- Quaternion Quaternion Quaternion Quaternion
The value to insert.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
InsertScalar(String, Single) InsertScalar(String, Single) InsertScalar(String, Single) InsertScalar(String, Single)
Inserts a Single key-value pair.
public : void InsertScalar(PlatForm::String propertyName, float value)public void InsertScalar(String propertyName, Single value)Public Function InsertScalar(propertyName As String, value As Single) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to insert.
- value
- float Single Single Single
The value of the property to insert.
InsertVector2(String, Vector2) InsertVector2(String, Vector2) InsertVector2(String, Vector2) InsertVector2(String, Vector2)
Inserts a Vector2 key-value pair.
public : void InsertVector2(PlatForm::String propertyName, Vector2 value)public void InsertVector2(String propertyName, Vector2 value)Public Function InsertVector2(propertyName As String, value As Vector2) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The key associated with the value. This key can be used to retrieve the value.
- value
- Vector2 Vector2 Vector2 Vector2
The value to insert.
InsertVector3(String, Vector3) InsertVector3(String, Vector3) InsertVector3(String, Vector3) InsertVector3(String, Vector3)
Inserts a Vector3 key-value pair.
public : void InsertVector3(PlatForm::String propertyName, Vector3 value)public void InsertVector3(String propertyName, Vector3 value)Public Function InsertVector3(propertyName As String, value As Vector3) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The key associated with the value. This key can be used to retrieve the value.
- value
- Vector3 Vector3 Vector3 Vector3
The value to insert.
InsertVector4(String, Vector4) InsertVector4(String, Vector4) InsertVector4(String, Vector4) InsertVector4(String, Vector4)
Inserts a Vector4 key-value pair.
public : void InsertVector4(PlatForm::String propertyName, Vector4 value)public void InsertVector4(String propertyName, Vector4 value)Public Function InsertVector4(propertyName As String, value As Vector4) As void// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The key associated with the value. This key can be used to retrieve the value.
- value
- Vector4 Vector4 Vector4 Vector4
The value to insert.
TryGetBoolean(String, Boolean) TryGetBoolean(String, Boolean) TryGetBoolean(String, Boolean) TryGetBoolean(String, Boolean)
Retrieves the specified boolean property value.
public : CompositionGetValueStatus TryGetBoolean(PlatForm::String propertyName, bool value)public CompositionGetValueStatus TryGetBoolean(String propertyName, Boolean value)Public Function TryGetBoolean(propertyName As String, value As Boolean) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
- value
- bool Boolean Boolean Boolean
If the operation is successful, this parameter will contain the specified boolean property value when the method returns.
Returns a CompositionGetValueStatus value indicating the outcome of retrieving the key-value pair.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
TryGetColor(String, Color) TryGetColor(String, Color) TryGetColor(String, Color) TryGetColor(String, Color)
Retrieves the specified Color property value.
public : CompositionGetValueStatus TryGetColor(PlatForm::String propertyName, Color value)public CompositionGetValueStatus TryGetColor(String propertyName, Color value)Public Function TryGetColor(propertyName As String, value As Color) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
If the operation is successful, this parameter will contain the specified Color property value when the method returns.
Returns a CompositionGetValueStatus value indicating the outcome of retrieving the key-value pair.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
TryGetMatrix3x2(String, Matrix3x2) TryGetMatrix3x2(String, Matrix3x2) TryGetMatrix3x2(String, Matrix3x2) TryGetMatrix3x2(String, Matrix3x2)
Retrieves the specified Matrix3x2 property value.
public : CompositionGetValueStatus TryGetMatrix3x2(PlatForm::String propertyName, Matrix3x2 value)public CompositionGetValueStatus TryGetMatrix3x2(String propertyName, Matrix3x2 value)Public Function TryGetMatrix3x2(propertyName As String, value As Matrix3x2) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
- value
- Matrix3x2 Matrix3x2 Matrix3x2 Matrix3x2
If the operation is successful, this parameter will contain the specified Matrix3x2 property value when the method returns.
Returns a CompositionGetValueStatus value indicating the outcome of retrieving the key-value pair.
TryGetMatrix4x4(String, Matrix4x4) TryGetMatrix4x4(String, Matrix4x4) TryGetMatrix4x4(String, Matrix4x4) TryGetMatrix4x4(String, Matrix4x4)
Retrieves the specified Matrix4x4 property value.
public : CompositionGetValueStatus TryGetMatrix4x4(PlatForm::String propertyName, Matrix4x4 value)public CompositionGetValueStatus TryGetMatrix4x4(String propertyName, Matrix4x4 value)Public Function TryGetMatrix4x4(propertyName As String, value As Matrix4x4) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
- value
- Matrix4x4 Matrix4x4 Matrix4x4 Matrix4x4
If the operation is successful, this parameter will contain the specified Matrix4x4 property value when the method returns.
Returns a CompositionGetValueStatus value indicating the outcome of retrieving the key-value pair.
TryGetQuaternion(String, Quaternion) TryGetQuaternion(String, Quaternion) TryGetQuaternion(String, Quaternion) TryGetQuaternion(String, Quaternion)
Retrieves the specified quaternion property value.
public : CompositionGetValueStatus TryGetQuaternion(PlatForm::String propertyName, Quaternion value)public CompositionGetValueStatus TryGetQuaternion(String propertyName, Quaternion value)Public Function TryGetQuaternion(propertyName As String, value As Quaternion) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
- value
- Quaternion Quaternion Quaternion Quaternion
If the operation is successful, this parameter will contain the specified quaternion property value when the method returns.
Returns an enumeration value indicating the outcome of retrieving the key-value pair.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
TryGetScalar(String, Single) TryGetScalar(String, Single) TryGetScalar(String, Single) TryGetScalar(String, Single)
Retrieves the specified Single property value.
public : CompositionGetValueStatus TryGetScalar(PlatForm::String propertyName, float value)public CompositionGetValueStatus TryGetScalar(String propertyName, Single value)Public Function TryGetScalar(propertyName As String, value As Single) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
- value
- float Single Single Single
If the operation is successful, this parameter will contain the specified Single property value when the method returns.
Returns a CompositionGetValueStatus value indicating the outcome of retrieving the key-value pair.
TryGetVector2(String, Vector2) TryGetVector2(String, Vector2) TryGetVector2(String, Vector2) TryGetVector2(String, Vector2)
Retrieves the specified Vector2 property value.
public : CompositionGetValueStatus TryGetVector2(PlatForm::String propertyName, Vector2 value)public CompositionGetValueStatus TryGetVector2(String propertyName, Vector2 value)Public Function TryGetVector2(propertyName As String, value As Vector2) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
- value
- Vector2 Vector2 Vector2 Vector2
If the operation is successful, this parameter will contain the specified Vector2 property value when the method returns.
Returns a CompositionGetValueStatus value indicating the outcome of retrieving the key-value pair.
TryGetVector3(String, Vector3) TryGetVector3(String, Vector3) TryGetVector3(String, Vector3) TryGetVector3(String, Vector3)
Retrieves the specified Vector3 property value.
public : CompositionGetValueStatus TryGetVector3(PlatForm::String propertyName, Vector3 value)public CompositionGetValueStatus TryGetVector3(String propertyName, Vector3 value)Public Function TryGetVector3(propertyName As String, value As Vector3) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
- value
- Vector3 Vector3 Vector3 Vector3
If the operation is successful, this parameter will contain the specified Vector3 property value when the method returns.
Returns a CompositionGetValueStatus value indicating the outcome of retrieving the key-value pair.
TryGetVector4(String, Vector4) TryGetVector4(String, Vector4) TryGetVector4(String, Vector4) TryGetVector4(String, Vector4)
Retrieves the specified Vector4 property value.
public : CompositionGetValueStatus TryGetVector4(PlatForm::String propertyName, Vector4 value)public CompositionGetValueStatus TryGetVector4(String propertyName, Vector4 value)Public Function TryGetVector4(propertyName As String, value As Vector4) As CompositionGetValueStatus// This API is not available in Javascript.
- propertyName
- PlatForm::String String String String
The name of the property to retrieve.
- value
- Vector4 Vector4 Vector4 Vector4
If the operation is successful, this parameter will contain the specified Vector4 property value when the method returns.
Returns a CompositionGetValueStatus value indicating the outcome of retrieving the key-value pair.