YouTube videos by bobtabor
if (NavigationContext.QueryString.TryGetValue("id", out id))
{
textBlock1.Text = String.Format("Value: {0}", id);
}
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
phoneAppService.State["myValue"] = textBox1.Text;
base.OnNavigatedFrom(e);
}
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
object someObject;
if (phoneAppService.State.ContainKey("myValue"))
{
if (phoneAppService.State.TryGetValue("myValue", out someObject))
{
textBox1.Text = someObject.ToString();
}
}
base.OnNavigatedTo(e);
}
<Grid ...>
<ListBox Height="", Width=...>
<ListBox.ItemTemplate>
<DataTemplate>
<HyperLinkButton Name="fileNameLinkButton" Content="{Binging}" Click="fileNameLinkButton_Click"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button ...>
</Button>
</Grid>
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));
}