Thursday, August 29, 2013

How to navigate from UserControl to ItemDetail Page

In a general sense, page navigation is achieved by using the Frame.Navigate method. For example, you could do the following based on the "XAML user and custom controls sample".


In that sample, there is a BasicUserControl with a Button, and the Button click has a function ClickMeButtonClicked event handler. If you change the Event Handler to implement the following, it should navigate to the desired page (BlankPage1 is a simple page I added to the project).



private void ClickMeButtonClicked(object sender, RoutedEventArgs e)
{
//OutputText.Text = string.Format("Hello {0}", NameInput.Text);
((Frame)(Window.Current.Content)).Navigate(typeof(BlankPage1));
}





Windows Store Developer Solutions #WSDevSol || Want more solutions? See our blog, http://aka.ms/t4vuvz


No comments:

Post a Comment