Danke: 0
Ergebnis 1 bis 3 von 3
-
Bin neu hier
- 28.08.2010, 12: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
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
-
Bin neu hier
- 28.10.2010, 11:01
- #2
Hallo Outlaw,
du musst im jeweiligen XAML deiner Sub-Pages natürlich auch die Deklaration deiner GlobalApplicationBar als als StaticResource setzen!
Beispiel:
<phone
honeApplicationPage
...
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, 21: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, 17:04 -
Global Adress List - Exchange
Von zehzhan im Forum HTC HeroAntworten: 3Letzter Beitrag: 31.08.2009, 20:04 -
Youtube application
Von Phill92 im Forum HTC Touch CruiseAntworten: 2Letzter Beitrag: 07.09.2008, 15:50














Tedera Pulse bewertungen