
Ergebnis 1 bis 3 von 3
-
Bin neu hier
- 28.08.2010, 11:48
- #1
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
Code:<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>
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, weilCode: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
-
Bin neu hier
- 28.10.2010, 10:01
- #2
Hallo Outlaw,
du musst im jeweiligen XAML deiner Sub-Pages natürlich auch die Deklaration deiner GlobalApplicationBar als als StaticResource setzen!
Beispiel:
<phonehoneApplicationPage
...
ApplicationBar="{StaticResource globalApplicationBar}">
Diese Zeile ist die, auf die es ankommt!
Hoffe Dir damit geholfen zu haben.
-
Mich gibt's schon länger
- 28.10.2010, 20:39
- #3
Ich glaube sein Problem ist nicht das einbinden im Xaml, sondern dass der Navigation Service in der app.xaml.cs nicht verfügbar ist.
Versuchs mal damit (ungestest, habs aus nem Blog):
PhoneApplicationFrame root = Application.Current.RootVisual as PhoneApplicationFrame;
root.Navigate(new Uri("/NextPage.xaml", UriKind.Relative));
Ähnliche Themen
-
Navilösung „Global Navigator 5.5“?
Von Unregistriert im Forum HTC Touch Pro 2Antworten: 0Letzter Beitrag: 29.10.2009, 16:04 -
Global Adress List - Exchange
Von zehzhan im Forum HTC HeroAntworten: 3Letzter Beitrag: 31.08.2009, 19:04 -
Youtube application
Von Phill92 im Forum HTC Touch CruiseAntworten: 2Letzter Beitrag: 07.09.2008, 14:50
Pixel 10 Serie mit Problemen:...