locked
Using Frame inside XBAP for navigation purposes RRS feed

  • Question

  • I have got a Page inside which I have a toolbar that contains ComboBox and buttons as its first row. In the second row I have a Frame for hosting pages. The reason why I host the pages in the frame is because I don't want my toolbar would change for different pages. 

    But when I change the source of the Frame or I navigate the Frame to the desire Page, the whole page changes (ie my toolbar vanishes). How can I force the Internet explorer to navigate the pages inside the Frame rather than in itself? 

              private void UserInformationUri_Click(object sender, RoutedEventArgs e)
              {
                  frame.NavigationService.Navigate(new Uri("Pages/UserInformation.xaml", UriKind.Relative));
                  //frame.Source = new Uri("Pages/UserInformation.xaml",UriKind.Relative);
              }

    Thursday, December 4, 2014 2:48 PM

Answers

  • I solve the problem by using UserControl. I created a UserControl containing the toolbar and implemented it in every page. It's not the most elegant way of doing but it works. I still don't understand why the frame inside the page doesn't change it's source to the new page, instead the Page containing the Frame changes to the new Page!
    Friday, December 5, 2014 9:26 AM
  • Hello Bopy,

    Thanks for sharing your solution.

    Maybe you can see some description by refer to the following thread:

    http://stackoverflow.com/questions/13950833/page-frame-navigation-windows-in-c-sharp-wpf

    "

    A Page is much like a user control, only that is is displayed within a Frame, which again is part of a NavigationWindow. A NavigationWindow is a special kind of window that allows for page navigation and can display the respective controls for navigating pages.

    A paged application is a good choice if you want Wizard-like functionality, or if the user experience should be comparable to what you get when browsing the web. In many cases, using standard WPF windows is a better choice.

    The NavigationWindow already contains a "fixed part" that can contain controls. You can also use a normal window, place a Frame in it and then - through proper layout - create your own "fixed parts". Navigation would then come down to calling the navigation methods the Frame provides.

    "Best regards,



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 5, 2014 10:42 AM

All replies

  • I solve the problem by using UserControl. I created a UserControl containing the toolbar and implemented it in every page. It's not the most elegant way of doing but it works. I still don't understand why the frame inside the page doesn't change it's source to the new page, instead the Page containing the Frame changes to the new Page!
    Friday, December 5, 2014 9:26 AM
  • Hello Bopy,

    Thanks for sharing your solution.

    Maybe you can see some description by refer to the following thread:

    http://stackoverflow.com/questions/13950833/page-frame-navigation-windows-in-c-sharp-wpf

    "

    A Page is much like a user control, only that is is displayed within a Frame, which again is part of a NavigationWindow. A NavigationWindow is a special kind of window that allows for page navigation and can display the respective controls for navigating pages.

    A paged application is a good choice if you want Wizard-like functionality, or if the user experience should be comparable to what you get when browsing the web. In many cases, using standard WPF windows is a better choice.

    The NavigationWindow already contains a "fixed part" that can contain controls. You can also use a normal window, place a Frame in it and then - through proper layout - create your own "fixed parts". Navigation would then come down to calling the navigation methods the Frame provides.

    "Best regards,



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 5, 2014 10:42 AM