动画风格怎么样? [英] how to style animation?
本文介绍了动画风格怎么样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有旋转抛出z轴的问题
但是我想把这个问题附加到anoter标签上
因为我需要为它设计风格
但是我不知道该怎么做
世界上其他人可以告诉我答案吗?
>
i have lebel that rotate throw the z axis
but i want to attache that aplliction to anoter labels
for that i need to style it
but i dont know how to do it
can someone else in the world can tell me the answer?
<!--from here i want to style the code so i can reuse it agiane for other button or label-->
<Viewport3D Grid.RowSpan="2" Grid.ColumnSpan="2" Grid.Column="1">
<Viewport3D.Camera>
<PerspectiveCamera Position="0, -0.1, 4"/>
</Viewport3D.Camera>
<Viewport2DVisual3D x:Name="v2dv3d">
<Viewport2DVisual3D.Transform>
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Angle="0" Axis="0, 1, 0" />
</RotateTransform3D.Rotation>
</RotateTransform3D>
</Viewport2DVisual3D.Transform>
<Viewport2DVisual3D.Geometry>
<MeshGeometry3D Positions="-1,1,0 -1,-1,0 1,-1,0 1,1,0"
TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3"/>
</Viewport2DVisual3D.Geometry>
<Viewport2DVisual3D.Material>
<DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>
</Viewport2DVisual3D.Material>
<!--here is the label rotate --> <Label Content="WpfPainter" Height="77" HorizontalAlignment="Left" Margin="54,45,0,0" Name="label1" VerticalAlignment="Top" Width="193" FontSize="26" FontFamily="Trajan Pro" Opacity="0.7" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" >
<Label.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard RepeatBehavior="0:0:4">
<Rotation3DAnimation Storyboard.TargetName="v2dv3d"
Storyboard.TargetProperty="(Viewport2DVisual3D.Transform).(RotateTransform3D.Rotation)"
Duration="0:0:2"
BeginTime="0:0:0">
<Rotation3DAnimation.From>
<AxisAngleRotation3D Angle="0" Axis="0, 1, 0" />
</Rotation3DAnimation.From>
<Rotation3DAnimation.To>
<AxisAngleRotation3D Angle="90" Axis="0, 1, 0" />
</Rotation3DAnimation.To>
</Rotation3DAnimation>
<Rotation3DAnimation Storyboard.TargetName="v2dv3d"
Storyboard.TargetProperty="(Viewport2DVisual3D.Transform).(RotateTransform3D.Rotation)"
Duration="0:0:2"
BeginTime="0:0:2">
<Rotation3DAnimation.From>
<AxisAngleRotation3D Angle="-90" Axis="0, 1, 0" />
</Rotation3DAnimation.From>
<Rotation3DAnimation.To>
<AxisAngleRotation3D Angle="0" Axis="0, 1, 0" />
</Rotation3DAnimation.To>
</Rotation3DAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Label.Triggers>
</Label>
</Viewport2DVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight Color="#FFFFFFFF" Direction="0,0,-1"/>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
<!--end of the style -->
推荐答案
< window x:class =WpfApplication1.Window1xmlns:x =#unknown>
xmlns =http:/ /schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x =http://schemas.microsoft.com / winfx / 2006 / xaml
Title =Window1Height =600Width =600ResizeMode =CanResizeWithGripLoaded =Window_Loaded>
< grid>
<window x:class="WpfApplication1.Window1" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="600" Width="600" ResizeMode="CanResizeWithGrip" Loaded="Window_Loaded">
<grid>
这篇关于动画风格怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文