Important
Composition Expression Language is case-insensitive.
Note
Only functions/operators not in the Microsoft Learn doc have their full signature mentioned here, others are just listed by their name
This gist documents the primitive types, subchannels, keywords, operators, functions, member functions, and animatable properties of the Composition Expression Language used for Composition Expression Animations since the Microsoft Learn documentation is outdated.
bool(akaBoolean) :TypeID: 0x11float(akaScalar) :TypeID: 0x12Vector2:TypeID: 0x23Vector3:TypeID: 0x34Vector4:TypeID: 0x45Color:TypeID: 0x46Quaternion:TypeID: 0x47Matrix3x2:TypeID: 0x68Matrix4x4:TypeID: 0x109TimeSpan:TypeID: 0x2APath:TypeID: 0x0B
Tip
TypeID can be used to calculate the number of supported subchannels like this numSubchannels = TypeID >> 4, so for example the number of subchannels supported for Matrix4x4 is 0x109 >> 4 which equals 16.
Vector2:X,YVector3:X,Y,ZVector4:X,Y,Z,WMatrix3x2:_11,_12,_21,_22,_31,_32Matrix4x4:_11,_12,_13,_14,_21,_22,_23,_24,_31,_32,_33,_34,_41,_42,_43,_44
Subchannels support swizzling, so something like this is possible:
var inputSource = ElementCompositionPreview.GetPointerPositionPropertySet(this);
var anim = compositor.CreateExpressionAnimation("source.Position.XXX");
anim.SetReferenceParameter("source", inputSource);ThisThis.StartingValueThis.CurrentValueThis.FinalValueThis.TargetTrueFalsePi:Constant: 3.1415927f
+-*==:bool(Color,Color),bool(Quaternion,Quaternion),bool(Matrix3x2,Matrix3x2),bool(Matrix4x4,Matrix4x4),bool(Vector4,Vector4),bool(bool,bool),bool(float,float),bool(Vector2,Vector2),bool(Vector3,Vector3)!=:bool(Color,Color),bool(Quaternion,Quaternion),bool(Matrix3x2,Matrix3x2),bool(Matrix4x4,Matrix4x4),bool(Vector4,Vector4),bool(bool,bool),bool(float,float),bool(Vector2,Vector2),bool(Vector3,Vector3)>:bool(float,float)>=:bool(float,float)<:bool(float,float)<=:bool(float,float)addsubtractdividemultiplyand:bool(bool,bool)or:bool(bool,bool)not:float(float)?,:%||&&
AbsMinMaxClampScaleTransformInverseLerpSlerpColorLerpColorLerpHSLColorLerpRGBLengthLengthSquaredDistanceDistanceSquaredModNormalizeConcatenateSinAsinCosAcosTanAtanCeilFloorRoundSqrtPowSquareLog10LnToDegreesToRadiansVector2Vector3Vector4ColorHSLQuaternionMatrix3x2Matrix4x4
Matrix3x2.CreateFromTranslationMatrix3x2.CreateTranslationMatrix4x4.CreateFromTranslationMatrix4x4.CreateTranslationMatrix3x2.CreateFromScaleMatrix3x2.CreateScaleMatrix4x4.CreateFromScaleMatrix4x4.CreateScaleMatrix3x2.CreateSkewMatrix3x2.CreateRotationMatrix4x4.CreateFromAxisAngleMatrix4x4.CreateRotationX:Matrix4x4(float),Matrix4x4(float,Vector3)Matrix4x4.CreateRotationY:Matrix4x4(float),Matrix4x4(float,Vector3)Matrix4x4.CreateRotationZ:Matrix4x4(float),Matrix4x4(float,Vector3)Matrix4x4.CreatePerspective:Matrix4x4(float,float,float,float)Matrix4x4.CreatePerspectiveFieldOfView:Matrix4x4(float,float,float,float)Matrix4x4.CreatePerspectiveOffCenter:Matrix4x4(float,float,float,float,float,float)Matrix4x4.CreateFromQuaternion:Matrix4x4(Quaternion)Matrix4x4.CreateFromYawPitchRoll:Matrix4x4(float,float,float)Quaternion.CreateFromAxisAngleQuaternion.CreateFromRotationMatrix:Quaternion(Matrix4x4)Quaternion.CreateFromYawPitchRoll:Quaternion(float,float,float)Quaternion.Lerp:Quaternion(Quaternion,Quaternion,float)TimeSpan.FromMilliSeconds:TimeSpan(float)TimeSpan.FromSeconds:TimeSpan(float)TimeSpan.FromMinutes:TimeSpan(float)Vector2.Dot:float(Vector2,Vector2)Vector2.Transform:Vector2(Vector2,Quaternion),Vector2(Vector2,Matrix3x2),Vector2(Vector2,Matrix4x4)Vector2.TransformNormal:Vector2(Vector2,Matrix3x2),Vector2(Vector2,Matrix4x4)Vector3.Cross:Vector3(Vector3,Vector3)Vector3.Dot:float(Vector3,Vector3)Vector3.Transform:Vector3(Vector3,Quaternion),Vector3(Vector3,Matrix4x4)Vector3.TransformNormal:Vector3(Vector3,Matrix4x4)Vector4.Dot:float(Vector4,Vector4)Vector4.Transform:Vector4(Vector4,Quaternion),Vector4(Vector4,Matrix4x4),Vector4(Vector3,Quaternion),Vector4(Vector3,Matrix4x4),Vector4(Vector2,Quaternion),Vector4(Vector2,Matrix4x4)
Important
Some animatable properties of some types are different than the projected WinRT properties of said types, see RectangleClip for an example of that.
-
AnchorPointCenterPointOffsetRotationAngleRotationAngleInDegreesScaleTransformMatrix
-
AnchorPointCenterPointOffsetOrientationRotationAngleRotationAngleInDegreesRotationAxisScaleTransformMatrix
-
SizeOpacityIsPixelSnappingEnabledIsVisibleRelativeOffsetAdjustmentRelativeSizeAdjustment
-
Color
-
ColorOffset
-
StartPointEndPoint
-
EllipseCenterEllipseRadiusGradientOriginOffset
-
BottomInsetBottomInsetScaleLeftInsetLeftInsetScaleRightInsetRightInsetScaleTopInsetTopInsetScale
-
HorizontalAlignmentRatioVerticalAlignmentRatioSnapToPixelsSuperDownSample
-
SourceOffsetSourceSize
-
LeftInsetTopInsetRightInsetBottomInset
-
LeftTopRightBottomTopLeftRadiusXTopLeftRadiusYTopRightRadiusXTopRightRadiusYBottomLeftRadiusXBottomLeftRadiusYBottomRightRadiusXBottomRightRadiusY
-
StrokeDashOffsetStrokeMiterLimitStrokeThickness
-
TrimStartTrimEndTrimOffset
-
CenterRadius
-
StartEnd
-
Path
-
OffsetSize
-
CornerRadiusOffsetSize
-
DelayTimeDurationPlaybackRateProgress
-
StartingValueCurrentValue
-
DelayTimeInitialValueFinalValueInitialVelocityAccelerationRestitution
-
DelayTimeInitialValueFinalValueInitialVelocityDampingRatioPeriod
-
ProgressPlaybackRate
-
Triggered
-
OffsetSizeHorizontalAlignmentRatioVerticalAlignmentRatio
-
BlurRadiusColorOffsetOpacity
-
BlurRadiusMultiplierMaxBlurRadiusMinBlurRadiusOpacityFalloffMaxOpacityMinOpacity
-
AlphaCutoffEmissiveFactorNormalScaleOcclusionStrength
-
TranslationOffset
-
BaseColorFactorMetallicFactorRoughnessFactor
-
CompositionManipulation (Read-only1)
InjectionsScaleDeltaScaleCenterPointPositionDeltaPositionMatrixPositionVelocityScaleVelocity
-
CompositionPointerEventRouter (Read-only1)
IsPositionXRailsEnabledIsPositionYRailsEnabled
-
InteractionTracker (Read-only1)
PositionPositionVelocityInPixelsPerSecondScaleScaleVelocityInPercentPerSecondMinPositionMaxPositionMinScaleMaxScalePositionInertiaDecayRateScaleInertiaDecayRateInertiaCenterpointXInertiaCenterpointYInertiaModifier_SetXInertiaModifier_SetYInertiaModifier_SetScaleInertiaModifier_SetXYNaturalRestingPositionNaturalRestingScaleIsPositionRoundingSuggestedIsInertiaFromImpulse
-
Point
-
TranslationScaleCenterPointPanMatrix
-
ColorIntensity
-
ColorDirectionIntensity
-
OffsetColorConstantAttenuationLinearAttenuationQuadraticAttenuationIntensityMinAttenuationCutoffMaxAttenuationCutoff
-
DirectionInnerConeAngleInnerConeAngleInDegreesInnerConeColorInnerConeIntensityOffsetOuterConeAngleOuterConeAngleInDegreesOuterConeColorOuterConeIntensityConstantAttenuationLinearAttenuationQuadraticAttenuationMinAttenuationCutoffMaxAttenuationCutoff
-
- D2D1 Effects :
[EffectName].[PropertyName]2 SceneLightingEffect[Name].AmbientAmount[Name].DiffuseAmount[Name].SpecularAmount[Name].SpecularShine
WhiteNoiseEffect[Name].Frequency[Name].Offset
- D2D1 Effects :
-
ScrollViewerManipulationPropertySet [ ManipulationTransform ]
-
Position3
-
Translation4
The default Composition keyframe animation easing function is defined like this:
Compositor.CreateCubicBezierEasingFunction(new Vector2(0.41f, 0.52f), new Vector2(0.0f, 0.94f));Footnotes
-
EffectNamecorresponds to the value ofIGraphicsEffect.Name,PropertyNameis queried throughIGraphicsEffectD2D1Interop::GetNamedPropertyMapping. ↩ -
This is hooked to
CompositionHoverPointerSource.Pointthrough an Expression Animation. ↩ -
Only if
ElementCompositionPreview.SetIsTranslationEnabledis set totrue. ↩