如何将Windows Phone Toolkit效果应用于控件?

时间:2013-09-10 16:22:50

标签: c# xaml windows-phone-7 windows-phone-8 windows-phone

我们可以将Windows Phone Toolkit的一些效果应用到这样的形式:

<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>

但是如何将它应用于特殊控件。像图像或网格?

2 个答案:

答案 0 :(得分:1)

要为控件制作动画,您应该使用Storyboard! http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard.aspx (看一下页面底部的例子)

编辑: WP似乎包含了一个属性:toolkit:TurnstileFeatherEffect.FeatheringIndex

您只需将每个元素的此属性设置为与订单相关的数字。所以0是第一个,1是第二个,依此类推......

答案 1 :(得分:0)

为什么不尝试将其放在 NavigationFrame 代码库

下的APP.XAML.CS中