开发者

FluidMoveBehavior triggering on Back navigation

I am working on a windows phone 7 application that uses the FluidMoveBehavior in some of my ListBoxes. For some reason, the FluidMoveBehavior animation seems to want to activate at inappropriate times. I currently have a ListBox on my main page, and I use the following ItemsPanelTemplate which is just a basic StackPanel with a FluidMoveBehavior attached to it:

<ItemsPanelTemplate x:Key="fancyListBoxItemsPanelTemplate"> 
    <StackPanel> 
        <Custom:Interaction.Behaviors> 
            <il:FluidMoveBehavior AppliesTo="Children"> 
                <il:FluidMoveBehavior.EaseX> 
                    <ExponentialEase EasingMode="EaseInOut"/> 
                </il:FluidMoveBehavior.EaseX> 
                <il:FluidMoveBehavior.EaseY> 
                    <ExponentialEase EasingMode="EaseInOut"/> 
                </il:FluidMoveBehavior.EaseY> 
            </il:FluidMoveBehavior> 
        </Custom:Interaction.Behaviors> 
    </StackPanel> 
</ItemsPanelTemplate> 

This works fine when I add/remove items while on the same screen. The animation plays perfectly. However, when I navigate to a new page from my main page, then navigate back, the fluid move animation is triggered as if all of the items were added at once. Is there any way to disable this behavior so it only triggers the a开发者_StackOverflow中文版nimation when the list actually changes?


this is happening because as you navigate to the page with the list box, the list box is created again, which is similar to adding all the items at once which in tuns fires the fluid move trigger. One possible (may not be the legitimate) solution is to have two identical ItemPanel template, one with the behavior and the other without it. When you first navigate to the page apply the template w/o the behavior. Later replace it with the one with the behavior. Hope that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜