以下代码无效:
private void fileNameLinkButton_Click(object sender, RoutedEventArgs e)
{
HyperlinkButton clickedLink = (HyperlinkButton)sender;
string uri = String.Format(
"/IsolatedStorageListing;component/SecondPage.xaml?id={0}",
clickedLink.Content);
NavigationService.Navigate(new Uri(uri, UriKind.Relative));
}
<ListBox Height="183"
Width="460"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Name="fileListBox">
<ListBox.ItemTemplate>
<DataTemplate>
<HyperlinkButton Name="fileNameLinkButton"
Content="{Binding}"
Click="fileNameLinkButton_Click" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
当我点击HyperlinkButton时,我的应用程序关闭/退出。请帮忙!
答案 0 :(得分:0)
我怀疑您需要在导航/IsolatedStorageListing;component
中添加Uri
。尝试删除它,只需离开/SecondPage.xaml?id={0}
顺便说一下,使用Content
导航参数真的很奇怪而且错误。我建议您将Tag
属性用于此类目的。