此篇文章主要是记录一下使用XamlReader加载动画时遇到的一些问题。
首先呢,把源码附上
1 <phone:PhoneApplicationPage 2 x:Class="PicChangedAnimation.MainPage" 3 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 4 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 5 xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 6 xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 7 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 8 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 9 mc:Ignorable="d" 10 xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 11 FontFamily="{StaticResource PhoneFontFamilyNormal}" 12 FontSize="{StaticResource PhoneFontSizeNormal}" 13 Foreground="{StaticResource PhoneForegroundBrush}" 14 SupportedOrientations="Portrait" Orientation="Portrait" 15 shell:SystemTray.IsVisible="True"> 16 <!--LayoutRoot 是包含所有页面内容的根网格--> 17 <Grid x:Name="LayoutRoot" Background="Transparent"> 18 <Image x:Name="image" Stretch="Fill" Source="/Image/a.jpg" RenderTransformOrigin="0.5,0.5"> 19 <Image.RenderTransform> 20 <CompositeTransform/> 21 </Image.RenderTransform> 22 <toolkit:GestureService.GestureListener> 23 <toolkit:GestureListener DragCompleted="GestureListener_DragCompleted_1"/> 24 </toolkit:GestureService.GestureListener> 25 </Image> 26 <Image x:Name="image1" Stretch="Fill" Source="/Image/b.jpg" RenderTransformOrigin="0.5,0.5"> 27 <Image.RenderTransform> 28 <CompositeTransform/> 29 </Image.RenderTransform> 30 <toolkit:GestureService.GestureListener> 31 <toolkit:GestureListener DragCompleted="GestureListener_DragCompleted_2"/> 32 </toolkit:GestureService.GestureListener> 33 </Image> 34 </Grid> 35 36 </phone:PhoneApplicationPage>