Answered by:
Show/Hide Specific ListView Items

Question
-
I have a pretty standard listview that looks like this:
<ListView x:Name="itemListView" AutomationProperties.AutomationId="ItemListView" AutomationProperties.Name="Grouped Items" ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}" ItemTemplate={StaticResource Standard80ItemTemplate}" IsItemClickEnabled="True" PointerReleased="itemListView_PointerReleased_1"> <ListView.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> <Grid x:Name="MyItems"> <StackPanel Orientation="Vertical"> <StackPanel x:Name="Header"> .... </StackPanel> <Grid x:Name="Details" Visibility="Collapsed"> .... </Grid> </StackPanel> ....
I'm basically displaying a list of items, and each item consists of 2 parts; a header and a grid of item details. I'm hiding all item details by default and only displaying the headers for users to click. I want to show the details of whichever item header is clicked in the following handler:
void itemListView_PointerReleased_1(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e) { // Hide all item details // Show details of the item we just clicked }
This is where I'm currently stuck; how would I get from Object^ sender to the UIElement I want to show/hide?
Saturday, June 9, 2012 9:28 PM
Answers
-
Hello,
I think you can try to use PopInThemeAnimation and PopOutThemeAnimation. You can follow this document
Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- Marked as answer by Jesse Jiang Wednesday, June 20, 2012 9:05 AM
Tuesday, June 12, 2012 8:37 AM -
Hi Inspira,
You could have a Dependency Property bound to the "Visibility" of the ListItem template and then manipulate it by using the SelectedItem in the EventArgs.
- Marked as answer by Jesse Jiang Wednesday, June 20, 2012 9:05 AM
Wednesday, June 13, 2012 6:34 PMModerator
All replies
-
Hello,
I think you can try to use PopInThemeAnimation and PopOutThemeAnimation. You can follow this document
Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- Marked as answer by Jesse Jiang Wednesday, June 20, 2012 9:05 AM
Tuesday, June 12, 2012 8:37 AM -
Hi Inspira,
You could have a Dependency Property bound to the "Visibility" of the ListItem template and then manipulate it by using the SelectedItem in the EventArgs.
- Marked as answer by Jesse Jiang Wednesday, June 20, 2012 9:05 AM
Wednesday, June 13, 2012 6:34 PMModerator -
can you give me an example to do this? I also met the same problem on how to show/hide the ListView item.
thanks!
My questions on MSDN.
Sunday, December 2, 2012 12:31 PM