Hallo!
Wie kann ich in einer Global Application Bar Navigieren?
Ok eine Global Application Bar erstellen ist nicht schwer, einfach in der App.xaml das einfuegen
So nun fehlen nch die Events, aber die definiert man einfach in der App.xaml.csCode:<Application.Resources>
<shell:ApplicationBar x:Name="globalApplicationBar" x:Key="globalApplicationBar" Opacity="0.7">
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarIconButton x:Name="homebutton" IconUri="/Images/appbar_button1.png" Text="Home" Click="homebutton_Click"/>
<shell:ApplicationBarIconButton x:Name="liveprogrammbutton" IconUri="/Images/appbar_button2.png" Text="Live Program" Click="liveprogrammbutton_Click"/>
<shell:ApplicationBarIconButton x:Name="videosbutton" IconUri="/Images/appbar_button2.png" Text="Videos" Click="videosbutton_Click"/>
<shell:ApplicationBarIconButton x:Name="morebutton" IconUri="/Images/appbar_button2.png" Text="More" Click="morebutton_Click"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</Application.Resources>
So, hier tut sich aber ein Problem auf. in der App.cs gibt es keinen NavigationService, weil die seite ja von Application ableitet und nicht wie auf einer Page, von PhoneApplicationPage.Code:void morebutton_Click(object sender, EventArgs e)
{
this.navigationService.Navigate(new Uri("/More.xaml", UriKind.Relative));
}
Ich versuchte auch schon einen NavigationService zu instanzieren, allerdings funktioniert das auch nicht, weilHat jemand eine Idee, wie ich durch eine globale Application Bar durch Seiten navigieren kann?Code:Error 1 The type 'System.Windows.Navigation.NavigationService' has no constructors defined C:\Users\Outlaw\Documents\Visual Studio 2010\Projects\WindowsPhoneApplication3\WindowsPhoneApplication3\App.xaml.cs 133 35 WindowsPhoneApplication3