locked
Display Group selection in Hub App

    Question

  • Please tell me how to display the groups selection to open it's items in hub app..

    Currently hub app for windows 8.1 displays the items and opens the "itempage".

    Monday, December 15, 2014 3:11 PM

All replies

  • I don't know what you mean, can you please explain?

    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.

    Monday, December 15, 2014 7:29 PM
    Moderator
  • In the Default Hub App for Windows Store 8.1,

    Here you can see that, In the Hub App by default, all the Items in a particular Group is displayed..

    Here is the xaml code

        <Page.Resources>
            <!-- Grid-appropriate 310 by 260 pixel item template as seen in section 4 -->
            <DataTemplate x:Key="Standard310x260ItemTemplate">
                <Grid Height="250" Width="310" Margin="5,10,5,10">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Border Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" Height="150">
                        <Image Source="{Binding ImagePath}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
                    </Border>
                    <StackPanel Grid.Row="1" Margin="0,10,0,0">
                        <TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
                        <TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60" />
                    </StackPanel>
                </Grid>
            </DataTemplate>
        </Page.Resources>

                <HubSection IsHeaderInteractive="True" DataContext="{Binding Section3Items}" d:DataContext="{Binding Groups[3], Source={d:DesignData Source=/DataModel/SampleData.json, Type=data:SampleDataSource}}"
                            x:Uid="Section3Header" Header="Section 3" Padding="40,40,40,32">
                    <DataTemplate>
                        <GridView
                            x:Name="itemGridView"
                            ItemsSource="{Binding Items}"
                            Margin="-9,-14,0,0"
                            AutomationProperties.AutomationId="ItemGridView"
                            AutomationProperties.Name="Items In Group"
                            ItemTemplate="{StaticResource Standard310x260ItemTemplate}"
                            SelectionMode="None"
                            IsSwipeEnabled="false"
                            IsItemClickEnabled="True"
                            ItemClick="ItemView_ItemClick">
                        </GridView>
                    </DataTemplate>
                </HubSection>

    How can I display the "Groups", So that when a Group is selected the Items inside are displayed.

    here is the screenshot of the default "Split app" template for Window store 8.1

    here in the above image, you can see that all the groups are displayed instead of the Items in a particular group.

    So my question is , how can I display the Groups instead of the items in the "Hub app" template.

    Tuesday, December 16, 2014 5:09 AM