locked
Getting each items from hubsection?

    Question

  • Now I also had be loading data to this hubsection. But I don't know how do I get items when I click on listview inside hubsection there(getting value of texblock on listview)???.

    The second, getting a menu(listbox) and click items event. I want when It be click the first items on a menu(litbox) then show on the the first pages of hubsection(it look like pivot)

    <Page.Resources>
        <CollectionViewSource x:Name="part"></CollectionViewSource>
    
    </Page.Resources>

    <HubSection x:Name="hubdic">
                                        <HubSection.Header>
                                            <TextBlock Text="txtDic" FontWeight="Medium" FontSize="20" Foreground="#00AAFF"></TextBlock>
                                        </HubSection.Header>
                                        <DataTemplate>
                                            <ListView x:Name="lstshowd" ItemsSource="{Binding Source={StaticResource parts}}">
                                                <ListView.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <WrapGrid Orientation="Vertical">                                                        
                                                        </WrapGrid>
                                                    </ItemsPanelTemplate>
                                                </ListView.ItemsPanel>
                                                <ListView.ItemTemplate>
                                                    <DataTemplate>
                                                        <Grid Width="200">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="130"></RowDefinition>
                                                                <RowDefinition Height="40"></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <Grid Grid.Row="0" Background="#e3e3e3">
                                                                <Image Source="{Binding thumb50}" Width="40" Height="40" VerticalAlignment="Center" HorizontalAlignment="Center"></Image>
                                                            </Grid>
                                                            <Grid Grid.Row="1" Background="White">
                                                                <StackPanel Margin="5">
                                                                    <TextBlock Text="{Binding name}" Foreground="Black" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
                                                                </StackPanel>
                                                            </Grid>                                                           
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListView.ItemTemplate>
                                            </ListView>
    
                                        </DataTemplate>
                                    </HubSection>

    Tuesday, April 07, 2015 1:33 AM

Answers

  • You don't have any events attached to the ListView, such as SelectionChanged, that would help you get the selected items from the ListView.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Le Thien Hoang Tuesday, April 07, 2015 10:12 PM
    • Unmarked as answer by Le Thien Hoang Wednesday, April 08, 2015 11:56 AM
    • Marked as answer by Le Thien Hoang Wednesday, April 08, 2015 11:56 AM
    Tuesday, April 07, 2015 1:24 PM
    Moderator

All replies

  • You don't have any events attached to the ListView, such as SelectionChanged, that would help you get the selected items from the ListView.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Le Thien Hoang Tuesday, April 07, 2015 10:12 PM
    • Unmarked as answer by Le Thien Hoang Wednesday, April 08, 2015 11:56 AM
    • Marked as answer by Le Thien Hoang Wednesday, April 08, 2015 11:56 AM
    Tuesday, April 07, 2015 1:24 PM
    Moderator
  • I had try such as selectionChanged but it "
    x:Name="lstshowd"
    " inside code will not available., I can't call lstshowd again.
    Tuesday, April 07, 2015 10:14 PM