We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Simple ExpressionAnimation that copies the Offset from one object to another does not work.
To Reproduce Create two CompositionVisual and link their Offset properties with Expression.
<Grid ColumnDefinitions="*, *"> <Panel x:Name="Root1" Background="Transparent" /> <Panel x:Name="Root2" Grid.Column="1" /> </Grid>
CompositionVisual rect1; CompositionVisual rect2; protected override void OnLoaded(RoutedEventArgs e) { base.OnLoaded(e); rect1 = CreateSolidColorVisual(Root1); rect2 = CreateSolidColorVisual(Root2); var anim = ElementComposition.GetElementVisual(this).Compositor.CreateExpressionAnimation(); anim.Target = "Offset"; anim.Expression = "Source.Offset"; anim.SetReferenceParameter("Source", rect1); rect2.StartAnimation("Offset", anim); Root1.PointerMoved += Root1_PointerMoved; } private CompositionVisual CreateSolidColorVisual(Visual visual) { var composition = ElementComposition.GetElementVisual(visual); var rectangle = composition.Compositor.CreateSolidColorVisual(); rectangle.Size = new Vector(100, 100); rectangle.Color = Colors.Red; ElementComposition.SetElementChildVisual(visual, rectangle); return rectangle; } private void Root1_PointerMoved(object? sender, Avalonia.Input.PointerEventArgs e) { var pos = e.GetPosition(Root1); rect1.Offset = new Vector3D(pos.X, pos.Y, 0); }
Expected behavior Both rectangles move synchronously.
For example:
Desktop:
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
Simple ExpressionAnimation that copies the Offset from one object to another does not work.
To Reproduce
Create two CompositionVisual and link their Offset properties with Expression.
1. View:
2. CodeBehind:
AvaloniaBehavior.mp4
Expected behavior
Both rectangles move synchronously.
For example:
WinUIBehavior.mp4
Desktop:
The text was updated successfully, but these errors were encountered: