The following code is not working:
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>
When I click the HyperlinkButton, my app closes/exit. Please help!
I doubt that you need to add
/IsolatedStorageListing;componentin the navigationUri. Try to remove it and simply leave/SecondPage.xaml?id={0}By the way, it is really strange and moreover wrong to use
Contentfor navigation parameter. I would suggest you to useTagproperty for such purposes.