相关疑难解决方法(0)

具有项目点击动画的长列表选择器

我正在努力Windows Phone 8,我有很长的列表选择器,其中包含很少的项目.当我点击我需要添加一些动画的项目时,移动文本并返回.如何实现这一目标?我也试图将相同的内容应用于列表框.

我试过这个:

<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>
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

以下是示例截图

在此输入图像描述

我怎样才能实现这一目标?

c# silverlight wpf windows-phone windows-phone-8

1
推荐指数
1
解决办法
1070
查看次数

标签 统计

c# ×1

silverlight ×1

windows-phone ×1

windows-phone-8 ×1

wpf ×1