本文介绍了如何启用两个部分以导航到Windows应用程序应用程序中的不同页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Windows应用程序。
i在设计中启用了两个中心部分,如果我点击任何一个它导航到同一页面的部分..但我希望他们两个导航到不同的页面..我需要做什么改变.. ???
这是我的设计页面
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
<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:
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
推荐答案
这篇关于如何启用两个部分以导航到Windows应用程序应用程序中的不同页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!