2013-07-16 54 views
3

我按照視頻「Put the Standard Animations in your App」中的說明爲我的Windows Phone應用創建了過渡動畫;然而,它並沒有真正的工作。如何在Windows Phone Toolkit中創建過渡動畫?

如果我理解正確,我所要做的就是在我的頁面添加幾行XAML,並且事情會自動進行......這不會發生在我身上;我錯過了什麼?

這裏是我的網頁XAML:

<phone:PhoneApplicationPage 
    x:Class="PhoneApp1.Page1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}" 
    FontSize="{StaticResource PhoneFontSizeNormal}" 
    Foreground="{StaticResource PhoneForegroundBrush}" 
    SupportedOrientations="Portrait" Orientation="Portrait" 
    shell:SystemTray.IsVisible="True"> 

    <toolkit:TransitionService.NavigationInTransition> 
     <toolkit:NavigationInTransition> 
      <toolkit:NavigationInTransition.Backward> 
       <toolkit:TurnstileTransition Mode="BackwardIn"/> 
      </toolkit:NavigationInTransition.Backward> 
      <toolkit:NavigationInTransition.Forward> 
       <toolkit:TurnstileTransition Mode="ForwardIn"/> 
      </toolkit:NavigationInTransition.Forward> 
     </toolkit:NavigationInTransition> 
    </toolkit:TransitionService.NavigationInTransition> 
    <toolkit:TransitionService.NavigationOutTransition> 
     <toolkit:NavigationOutTransition> 
      <toolkit:NavigationOutTransition.Backward> 
       <toolkit:TurnstileTransition Mode="BackwardOut"/> 
      </toolkit:NavigationOutTransition.Backward> 
      <toolkit:NavigationOutTransition.Forward> 
       <toolkit:TurnstileTransition Mode="ForwardOut"/> 
      </toolkit:NavigationOutTransition.Forward> 
     </toolkit:NavigationOutTransition> 
    </toolkit:TransitionService.NavigationOutTransition> 

    <Grid x:Name="LayoutRoot" Background="Transparent"> 
     <Grid.RowDefinitions> 
      <RowDefinition Height="Auto"/> 
      <RowDefinition Height="*"/> 
     </Grid.RowDefinitions> 

     <StackPanel Grid.Row="0" Margin="12,17,0,28"> 
      <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/> 
      <TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> 
     </StackPanel> 

     <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> 
      <Button x:Name="ClickMe" HorizontalAlignment="Center" Click="ClickMe_OnClick">Click Me</Button> 
     </Grid> 
    </Grid> 

</phone:PhoneApplicationPage> 

回答

10

你也改變你的根幀的過渡幀?在您的App.xaml.cs文件中,將標準PhoneApplicationFrame替換爲TransitionFrame -

//RootFrame = new PhoneApplicationFrame(); 
RootFrame = new TransitionFrame();