I am working on a Windows 8 project. I am using Visual Studio 2012 and predefined templates (GroupedPage, SplitPage, ItemsPage).
At this time, I need to add an application bar. the way I choose is to create it and display it on all pages. I read this article: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj150604.aspx
To include this in my project, I set the global page as the start page in App.xaml
protected async override void OnLaunched(LaunchActivatedEventArgs args) ... if (!rootFrame.Navigate(typeof(GlobalPage), args.Arguments)) throw new Exception("Failed to create initial page"); ...
On the global page, I change the OnLaunched method to go to the real main page:
rootPage = e.Parameter as Page; frame1.Navigate(typeof(MainPage), this);
I am adding event subscription for buttons, for example
private void ButtonBlogList_Click(object sender, RoutedEventArgs e) { this.Frame.Navigate(typeof(BlogListManagement), this); }
After launching the application, the application bar is displayed, and I can navigate using the application button inside, but after the first navigation the AppBar does not appear on the landing page.
Any idea of my mistake?
Thank you for your help.
c # windows-8 xaml microsoft-metro appbar
Xstahef
source share