我在我的应用程序中有一个 ListBox
,它包含显示一些数据的 TextBlock
。这些 TextBlock
被设置为在用户单击它们时触发事件。
<ListBox x:Name="ListBoxCategories"
Margin="0,0,-12,0"
ItemsSource="{Binding ListBoxItems}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17"
Width="432">
<TextBlock Text="{Binding ItemName}"
TextWrapping="Wrap"
MouseLeftButtonDown="TextBlock_MouseLeftButtonDown"
Style="{StaticResource PhoneTextLargeStyle}"
Foreground="{StaticResource PhoneAccentBrush}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
这个功能已经实现了,但是如果用户点击一个项目时有一些动画效果就更好了。例如,当你从手机的通讯录中选择一个联系人并点击其中一个操作(比如“发送电子邮件”或“拨打移动电话”)时,文本会在执行所选操作之前短暂地移动。有没有办法做到这一点?