Skip to content

Commit 243df4e

Browse files
committed
Add extensions support for CompositionConditionalValue
1 parent 2a4938d commit 243df4e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Microsoft.Toolkit.Uwp.UI.Animations/Expressions/CompositionExtensions.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,26 @@ public static void SetMotion(this InteractionTrackerInertiaMotion modifier, Expr
221221
modifier.Motion = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
222222
}
223223

224+
/// <summary>
225+
/// Use the value of specified ExpressionNode to determine if this composition conditional value modifier should be chosen.
226+
/// </summary>
227+
/// <param name="modifier">The modifier.</param>
228+
/// <param name="expressionNode">The root ExpressionNode that represents the ExpressionAnimation.</param>
229+
public static void SetCondition(this CompositionConditionalValue modifier, ExpressionNode expressionNode)
230+
{
231+
modifier.Condition = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
232+
}
233+
234+
/// <summary>
235+
/// Use the value of specified ExpressionNode as the resting value for this composition conditional value
236+
/// </summary>
237+
/// <param name="modifier">The modifier.</param>
238+
/// <param name="expressionNode">The root ExpressionNode that represents the ExpressionAnimation.</param>
239+
public static void SetRestingValue(this CompositionConditionalValue modifier, ExpressionNode expressionNode)
240+
{
241+
modifier.Value = CreateExpressionAnimationFromNode(modifier.Compositor, expressionNode);
242+
}
243+
224244
/// <summary>
225245
/// Creates the expression animation from node.
226246
/// </summary>

0 commit comments

Comments
 (0)