I have a ListBox
in my application that contains TextBlock
s displaying some data. The TextBlock
s are setup to fire an event when the user clicks on them.
<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>
This works as I want it to, but it'd be great if I could provide some sort of animation when the user clicks on an item. For instance, when you select a contact from the phone's address book and click on one of the actions (such as "send email" or "call mobile") the text briefly moves before the selected action is performed. Is there any way of doing this?
Create a story board with blend to move the text box.
Start the story board from the click event handler.
Perform your action in the story board finished event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With