ListView ItemClick
-
Saturday, April 21, 2012 8:24 PM
I have ListView like this
<ListView AutomationProperties.AutomationId="ItemListView" AutomationProperties.Name="Grouped Items" ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}" ItemTemplate="{StaticResource SmallItemTemplate}" ItemContainerStyle="{StaticResource SmallTileStyle}" SelectionMode="None" IsItemClickEnabled="True" ItemClick="ItemView_ItemClick"You can see that I use collection for binding elements. And DataTemplate for their layout
On Item click I want to have position and size of Item that clicked,
I mean here
private void ItemView_ItemClick(object sender, ItemClickEventArgs e) {I want to have ability to achieve UIElement that lives inside ListView, that elment that was touched.
I know how to achieve position of UIElement, but I cant find the way how to find this element in ItemClick method
Thanks for any help.
All Replies
-
Monday, April 23, 2012 2:08 AMModerator
Hi WishMaterTS,
You can user ItemContainerGenerator to retrieve the container from the item.
listview.ItemContainerGenerator.ContainerFromItem(e.ClickedItem);
Best regards,Min Zhu [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Matt SmallMicrosoft Employee, Moderator Wednesday, April 25, 2012 1:46 PM
-
Monday, April 23, 2012 4:32 PMthis is helpful thank you.


