<controltemplate targettype="{x:type Button}"> <border x:name="Btn_border"Background="{TemplateBinding Background}"> <textblock x:name="Btn_text"opacity="0"rendertransformorigin="0.5,0.5"text="{TemplateBinding Content}"Fontsize=" -"fontfamily="Candara"Foreground="Red"fontweight="Normal"Horizontalalignment="Center"Verticalalignment="Top"margin="0 5 0 0"> <TextBlock.RenderTransform> <rotatetransform>& Lt;/rotatetransform> </TextBlock.RenderTransform> </textbloc k> </Border> <ControlTemplate.Triggers> <tr Igger property="IsMouseOver"Value="True"> <setter property="Cursor"Value="Hand"Targetname="Btn_border"/> <setter property="Opacity"Value="1"Targetname="Btn_text"> </Setter> </Trigger> <eventtr Igger routedevent="Button.mouseenter"> <EventTrigger.Actions> <BeginStoryboard> <storyboard > <doubleanimation Storyboard.ta Rgetname="Btn_text"Storyboard.TargetProperty="Rendertransform.angle"BeginTime="00:00:00"From="0"to="5"duration="00:00:0.1"AutoReverse="True"Repeatbehavior="Forever"/> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> &L T EventTrigger routedevent="Button.mouseleave"> <BeginStoryboard> <Storyboard> <doubleanimation storyboard.targetname="Btn_text"storyboard.targetproperty="Rendertransform.angle"BeginTime="00:00:00"From="0"to="0"duration="00:00:0.1"Autoreverse="True"/> </Storyboard> </BeginStoryboard> </EventTrigger> </ControlTemplate.Triggers> </CONTROLTEMPLATE&G T
The key is to declare the element center Rendertransformorigin (0.5,0.5) within the element that needs to be transformed
<xx. Rendertransform>
<RotateTransform></RotateTransform>
</xx. Rendertransform>
Then define the routed event control in <Template.Tragers>, define the storyboard, trigger
Button template, title Jitter