Show/Hide Specific ListView Items RRS feed

  • Question

  • I have a pretty standard listview that looks like this:

    <ListView x:Name="itemListView"
        AutomationProperties.Name="Grouped Items"
        ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
        ItemTemplate={StaticResource Standard80ItemTemplate}"
                        <Grid x:Name="MyItems">
                            <StackPanel Orientation="Vertical">
                                <StackPanel x:Name="Header">
                                <Grid x:Name="Details" Visibility="Collapsed">

    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


All replies