Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
am working on windows app application.

i have enabled two hub sections in design, if i click on any one of the sections it is navigating to same page.. but i want both of them to navigate to different pages.. what changes do i have to make..???
this is my design page
HTML
 <page.resources>
    <datatemplate x:key="StandardItemTemplate" xmlns:x="#unknown">
        <grid height="250" width="310" margin="5,10,5,10">
            <grid.rowdefinitions>
                <rowdefinition height="Auto" />
                <rowdefinition height="*" />
            </grid.rowdefinitions>
            <border removed="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" height="180">
                <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="40" />
            </stackpanel>
        </grid>
    </datatemplate>
    <datatemplate x:key="RecipeGroupTemplate" xmlns:x="#unknown">
        <gridview>
            ItemsSource="{Binding Items}"
            Margin="-9,-14,0,0"
            ItemTemplate="{StaticResource StandardItemTemplate}"
            SelectionMode="None"
            IsSwipeEnabled="false"
            IsItemClickEnabled="True"
            ItemClick="ItemView_ItemClick">
        </gridview>
    </datatemplate>
</page.resources>

<grid removed="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <grid.childrentransitions>
        <transitioncollection>
            <entrancethemetransition />
        </transitioncollection>
    </grid.childrentransitions>

    <hub sectionheaderclick="Hub_SectionHeaderClick">
        <hub.header>
            <!-- Back button and page title -->
            <grid>
                <grid.columndefinitions>
                    <columndefinition width="80" />
                    <columndefinition width="*" />
                </grid.columndefinitions>
                <Button  x:Name="backButton" Style="{StaticResource NavigationBackButtonNormalStyle}"
                    Margin="0,0,39,0" 
                    VerticalAlignment="Top"
                    Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
                    AutomationProperties.Name="Back"
                    AutomationProperties.AutomationId="BackButton"
                    AutomationProperties.ItemType="Navigation Button"/>
                <textblock x:name="pageTitle" text="IMenu" style="{StaticResource HeaderTextBlockStyle}" grid.column="1" xmlns:x="#unknown">
                    VerticalAlignment="Top" IsHitTestVisible="false" TextWrapping="NoWrap" />
            </textblock></grid>
        </hub.header>

        <hubsection width="780" margin="0,0,80,0">
            <hubsection.background>
                <ImageBrush ImageSource="Assets/Nudel Narrow.jpg" Stretch="UniformToFill" />
            </hubsection.background>
        </hubsection>

        <!-- Recipe sections -->
        <hubsection isheaderinteractive="True" datacontext="{Binding RecipeGroups[0]}" d:datacontext="{Binding Groups[0], Source={d:DesignData Source=../ContosoCookbookUniversal.Shared/DataModel/RecipeData.json, Type=data:RecipeDataSource}}" xmlns:d="#unknown">
                    Header="{Binding Title}" Padding="40,40,40,32" ContentTemplate="{StaticResource RecipeGroupTemplate}" >
        </hubsection>

    </hub>
</grid>

Here is the code:
C#
void ItemView_ItemClick(object sender, ItemClickEventArgs e)
{
    this.Frame.Navigate(typeof(CategoryType) );
   // this.Frame.Navigate(typeof(Feedback));
}

I have enabled only two hub sections, if i click on any one of the sections it is navigating to same page.. but i want both of them to navigate to different pages.. what changes do i have to make
Posted
Updated 31-Jul-14 22:15pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900