2 using System.Collections.Generic;
6 using System.Windows.Controls;
7 using System.Windows.Documents;
10 using System.Windows.Media.Animation;
11 using System.Windows.Navigation;
12 using System.Windows.Shapes;
13 using Microsoft.Phone.Controls;
14 using Microsoft.Phone.Shell;
18 public partial class App : Application
24 public PhoneApplicationFrame
RootFrame {
get;
private set; }
32 UnhandledException += Application_UnhandledException;
35 if (
System.Diagnostics.Debugger.IsAttached )
38 Application.Current.Host.Settings.EnableFrameRateCounter =
true;
49 InitializeComponent();
52 InitializePhoneApplication();
57 private void Application_Launching(
object sender, LaunchingEventArgs e )
63 private void Application_Activated(
object sender, ActivatedEventArgs e )
69 private void Application_Deactivated(
object sender, DeactivatedEventArgs e )
75 private void Application_Closing(
object sender, ClosingEventArgs e )
80 private void RootFrame_NavigationFailed(
object sender, NavigationFailedEventArgs e )
82 if (
System.Diagnostics.Debugger.IsAttached )
85 System.Diagnostics.Debugger.Break();
90 private void Application_UnhandledException(
object sender, ApplicationUnhandledExceptionEventArgs e )
92 if (
System.Diagnostics.Debugger.IsAttached )
95 System.Diagnostics.Debugger.Break();
99 #region Phone application initialization 102 private bool phoneApplicationInitialized =
false;
105 private void InitializePhoneApplication()
107 if ( phoneApplicationInitialized )
113 RootFrame.Navigated += CompleteInitializePhoneApplication;
116 RootFrame.NavigationFailed += RootFrame_NavigationFailed;
119 phoneApplicationInitialized =
true;
123 private void CompleteInitializePhoneApplication(
object sender, NavigationEventArgs e )
130 RootFrame.Navigated -= CompleteInitializePhoneApplication;
PhoneApplicationFrame RootFrame
Provides easy access to the root frame of the Phone Application.
App()
Constructor for the Application object.