我希望我的应用转移到点击到中心部分的说明页面 但代码不起作用......
这是我的xaml ,有很多部分,但已宣布一个..
<Hub Header="Hub" x:Name="hub" HorizontalAlignment="Left" VerticalAlignment="Top" Height="420" Width="1500" Grid.Row="1" Margin="0,113,-134,0">
<HubSection x:Name="one" Header="HubSection 0" Width="330" Height="380" >
<HubSection.Background>
<ImageBrush Stretch="Uniform" ImageSource="Assets/ck.png"/>
</HubSection.Background>
<DataTemplate>
<Hub SectionHeaderClick="Hub_SectionHeaderClick" Padding="40,40,0,0" Name="click">
</Hub>
</DataTemplate>
</HubSection>
</Hub>
这是我的Css
private void Hub_SectionHeaderClick(object sender, HubSectionHeaderClickEventArgs e)
{
this.Frame.Navigate(typeof(descripton));
}
答案 0 :(得分:0)
您正在使用A DataTemplate,但这需要与ItemsControl相关联。
试试这个:
<Hub Header="Hub" x:Name="hub" HorizontalAlignment="Left" VerticalAlignment="Top" Height="420" Width="1500" Grid.Row="1" Margin="0,113,-134,0">
<HubSection x:Name="one" Header="HubSection 0" Width="330" Height="380" Tapped="Hub_SectionHeaderClick">
<HubSection.Background>
<ImageBrush Stretch="Uniform" ImageSource="Assets/ck.png"/>
</HubSection.Background>
</HubSection>
</Hub>
谢谢,