0
我的目的是建立动画复选标记,并为此使用两个矩形。但是我无法正确连接这些矩形(这可以在一个设备上看起来不错,但在另一个分辨率下,设备可以看到该关节)。我的问题是如何将这些矩形的坐标放在代码后面? XAML代码提供以下旋转矩形结点WPF UWP
<Grid x:Name="gridMain">
<Rectangle x:Name="RectCheck1" HorizontalAlignment="Left" RenderTransformOrigin="1,1" Fill="{Binding Color,ElementName=check}" Height="18" Width="50" Visibility="Visible">
<Rectangle.Projection>
<PlaneProjection RotationZ="-45" CenterOfRotationX="0" CenterOfRotationY="0" CenterOfRotationZ="0"/>
</Rectangle.Projection>
<Rectangle.RenderTransform>
<CompositeTransform x:Name="RectTrans1" />
</Rectangle.RenderTransform>
<Rectangle.Resources>
<Storyboard x:Name="RectCheck1Draw" Storyboard.TargetName="RectCheck1">
<DoubleAnimation x:Name="RectAnim1Width" EnableDependentAnimation="True" Storyboard.TargetProperty="Width" From="0" To="50" Duration="0:0:2" RepeatBehavior="1x" />
</Storyboard>
</Rectangle.Resources>
</Rectangle>
<Rectangle x:Name="RectCheck2" Fill="{Binding Color,ElementName=check}" HorizontalAlignment="Left" Height="18" Width="70" Visibility="Visible">
<Rectangle.Projection>
<PlaneProjection RotationZ="45" CenterOfRotationX="0" CenterOfRotationY="0" CenterOfRotationZ="0"/>
</Rectangle.Projection>
<Rectangle.RenderTransform>
<CompositeTransform x:Name="RectTrans2" />
</Rectangle.RenderTransform>
<Rectangle.Resources>
<Storyboard x:Name="RectCheck2Draw" Storyboard.TargetName="RectCheck2">
<DoubleAnimation x:Name="RectAnim2Width" EnableDependentAnimation="True" Storyboard.TargetProperty="Width" From="0" To="70" Duration="0:0:3" RepeatBehavior="1x" />
</Storyboard>
</Rectangle.Resources>
</Rectangle>
</Grid>
它看起来像你的第一个矩形的顶部缺失。它也有投影吗?你能否也请添加该代码?你只是想在代码中移动两个矩形位置? –
对不起,代码现在被编辑... – cybergogic