长长的名单选择与项目水龙头动画 [英] Long List Selector with item tap animation

查看:145
本文介绍了长长的名单选择与项目水龙头动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作的Windows Phone 8 ,我有与它。当几个项目我在我需要一些动画添加到其喜欢的项目挖掘一长串选择,移动文本,并提出back.How实现这一目标? 。我试图采用同样的列出盒以及

I am working on Windows Phone 8, i have long list selector with few items in it.When i tap on the items i need to add some animation to it like, move the text in and come back.How to achieve this? i am trying to apply the same to list box as well.

我已经试过这样:

<Style x:Key="LongListSelectorStyle1" TargetType="phone:LongListSelector">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="ItemTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <UserControl>
                            <Border x:Name="MyBorder" Background="Transparent">
                                <VisualStateManager.VisualStateGroups  >
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="Selected">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background)" Storyboard.TargetName="MyBorder">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="#000000"/>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                            </Border>
                        </UserControl>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>



但它不工作。

But its not working.

下面是样本截图

我怎样才能做到这一点?

How can i achieve this ?

推荐答案

我会尝试使用WPToolkit,其中有就是当按下你的ListBox或LongListSelector一个项目你可以申请一个'倾斜'动画的选项。很酷。首先,你需要通过的NuGet获得该工具包在Visual Studio https://www.nuget.org /packages/WPtoolkit/4.2013.8.16 (链接到网站,但你加它本身使用Visual Studio中的软件包管理器控制台,它会自动完成所有设置)。检查此链接 HTTP://www.davidsalter。 COM / 2013/09 /使用窗口电话的工具包,在wp8.html ,一旦你拥有了它,在wher亿邮声明的ListBox或LongListSelector本身的标签,插入下面

I would try using the WPToolkit, in which there is the option where you can apply a 'tilt' animation when an item in your ListBox or LongListSelector is pressed. Very cool. First you need to get the toolkit via NuGet in Visual Studio https://www.nuget.org/packages/WPtoolkit/4.2013.8.16 (a link to the site but you add it using the Package Manager Console within Visual Studio itself and it sets everything up automatically). Check this link http://www.davidsalter.com/2013/09/using-windows-phone-toolkit-in-wp8.html and once you have it, Within the tag wher eyou declared the ListBox or LongListSelector itself, insert the following

`<ListBox ... toolkit:TiltEffect.IsTiltEnabled="True" ../>

这应该工作。

这篇关于长长的名单选择与项目水龙头动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆