前台
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Button Name="btnvalue" width="400" Height="80" Content="旋转按钮" fontsize="30">
<Button.RenderTransform>
<RotateTransfrom X:Name="rf1"/>
</Button.RenderTransform>
</Button>
<Button Name="btn" Content="动起来" fontsize="30" Click="Button_Click"/>
</Grid>
后台
Protected override void OnNavigatedTo(NavigationEventArgs e)
{
DispatcherTimer timer=new DispatcherTimer();
timer.Interval=TimeSpan.FromMilliSeconds(200);
timer.Tick+=timer_Tick;
timer.Start();
}
void timer_Tick(object sender,object e)
{
rf1.Angle+=10;
}
Private void Button_Click_1(object Sender,RoutedEventArgs e)
{
RotateTransform oldrotate=btnvalue.RenderTransform as RotateTransfrom;
MessageDialog mes=new MessageDialog(oldrotate.Angle.ToString());
mes.ShowAsync();
}