none
button navigation to a page RRS feed

  • Question

  • Hi, if i have an application which at one side there is a navigation panel(a user control) with buttons in it. When i click on one button, a corresponding page(written in xaml and c#) will pop up in the another panel within the same application. The problem now is that i'm not sure how to do show the corresponding page after i click on the button. Can somebody explain or give me some tips on how to accomplish this?

     

    Thanks in advance 

    Friday, March 21, 2008 4:23 AM

Answers

  • you could create the corresponding page as user control. then on button click do something like

     

    UserControl mycontrol = new UserControl();

    anotherPanel.Children.Add(mycontrol);

     

    Friday, March 21, 2008 4:49 AM

All replies

  • you could create the corresponding page as user control. then on button click do something like

     

    UserControl mycontrol = new UserControl();

    anotherPanel.Children.Add(mycontrol);

     

    Friday, March 21, 2008 4:49 AM
  •  

    Hi, thanks for the reply. Just another question, how do i link the page(xaml and c#) in the mycontrol(according to the code you given above?

     

    Thanks in advance

    Friday, March 21, 2008 5:56 AM
  • the page (xaml and c#) would itself be some class. in the C#, derive that class from UserControl and then instantiate as per the code above

     

    Sunday, March 23, 2008 5:04 AM