public MainPage()
            : base()
        {
            InitializeComponent();
            base.Initialize();

            // It is the first launch of the app if this key doesn't exist.  Otherwise we are returning
            // to the main page after tombstoning and showing the splash screen looks bad
            if (PhoneApplicationService.Current.State.ContainsKey("ShowLoadingSplash") == false)
            {
                ShowLoadingSplash();
            }

            viewModel      = aViewModel as MainPageVM;
            firstLoad      = true;
            navigatedAway  = false;
            navigationLock = new Object();

            this.Loaded += new RoutedEventHandler(MainPage_Loaded);

            SupportedOrientations = SupportedPageOrientation.Portrait;

            this.ApplicationBar.ForegroundColor = ((SolidColorBrush)Application.Current.Resources["OBAForegroundBrush"]).Color;
            // the native theme uses a shade of "gray" that is actually white or black with an alpha mask.
            // the appbar needs to be opaque.
            ColorAlphaConverter alphaConverter = new ColorAlphaConverter();
            SolidColorBrush     appBarBrush    = (SolidColorBrush)alphaConverter.Convert(
                Application.Current.Resources["OBADarkBrush"],
                typeof(SolidColorBrush),
                Application.Current.Resources["OBABackgroundBrush"],
                null
                );

            this.ApplicationBar.BackgroundColor = appBarBrush.Color;
        }
        public DetailsPage()
            : base()
        {
            InitializeComponent();
            base.Initialize();

            this.Loaded       += new RoutedEventHandler(DetailsPage_Loaded);
            this.Unloaded     += new RoutedEventHandler(DetailsPage_Unloaded);
            this.BackKeyPress += new EventHandler <System.ComponentModel.CancelEventArgs>(DetailsPage_BackKeyPress);

            appbar_favorite = ((ApplicationBarIconButton)ApplicationBar.Buttons[0]);

            viewModel = Resources["ViewModel"] as RouteDetailsVM;

            busArrivalUpdateTimer          = new DispatcherTimer();
            busArrivalUpdateTimer.Interval = new TimeSpan(0, 0, 0, 30, 0); // 30 secs
            busArrivalUpdateTimer.Tick    += new EventHandler(busArrivalUpdateTimer_Tick);

            this.ApplicationBar.ForegroundColor = ((SolidColorBrush)Application.Current.Resources["OBAForegroundBrush"]).Color;
            // the native theme uses a shade of "gray" that is actually white or black with an alpha mask.
            // the appbar needs to be opaque.
            ColorAlphaConverter alphaConverter = new ColorAlphaConverter();
            SolidColorBrush     appBarBrush    = (SolidColorBrush)alphaConverter.Convert(
                Application.Current.Resources["OBADarkBrush"],
                typeof(SolidColorBrush),
                Application.Current.Resources["OBABackgroundBrush"],
                null
                );

            this.ApplicationBar.BackgroundColor = appBarBrush.Color;

#if SCREENSHOT
            SystemTray.IsVisible = false;
#endif
        }
        public MainPage()
            : base()
        {
            InitializeComponent();
            base.Initialize();

            // It is the first launch of the app if this key doesn't exist.  Otherwise we are returning
            // to the main page after tombstoning and showing the splash screen looks bad
            if (PhoneApplicationService.Current.State.ContainsKey("ShowLoadingSplash") == false)
            {
                ShowLoadingSplash();
            }

            viewModel = aViewModel as MainPageVM;
            firstLoad = true;
            navigatedAway = false;
            navigationLock = new Object();

            this.Loaded += new RoutedEventHandler(MainPage_Loaded);

            SupportedOrientations = SupportedPageOrientation.Portrait;

            this.ApplicationBar.ForegroundColor = ((SolidColorBrush)Application.Current.Resources["OBAForegroundBrush"]).Color;
            // the native theme uses a shade of "gray" that is actually white or black with an alpha mask.
            // the appbar needs to be opaque.
            ColorAlphaConverter alphaConverter = new ColorAlphaConverter();
            SolidColorBrush appBarBrush = (SolidColorBrush)alphaConverter.Convert(
                                                            Application.Current.Resources["OBADarkBrush"], 
                                                            typeof(SolidColorBrush), 
                                                            Application.Current.Resources["OBABackgroundBrush"], 
                                                            null
                                                            );

            this.ApplicationBar.BackgroundColor = appBarBrush.Color;
        }
        public DetailsPage()
            : base()
        {
            InitializeComponent();
            base.Initialize();

            this.Loaded += new RoutedEventHandler(DetailsPage_Loaded);
            this.Unloaded += new RoutedEventHandler(DetailsPage_Unloaded);
            this.BackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(DetailsPage_BackKeyPress);

            appbar_favorite = ((ApplicationBarIconButton)ApplicationBar.Buttons[0]);

            viewModel = Resources["ViewModel"] as RouteDetailsVM;

            busArrivalUpdateTimer = new DispatcherTimer();
            busArrivalUpdateTimer.Interval = new TimeSpan(0, 0, 0, 30, 0); // 30 secs 
            busArrivalUpdateTimer.Tick += new EventHandler(busArrivalUpdateTimer_Tick);

            this.ApplicationBar.ForegroundColor = ((SolidColorBrush)Application.Current.Resources["OBAForegroundBrush"]).Color;
            // the native theme uses a shade of "gray" that is actually white or black with an alpha mask.
            // the appbar needs to be opaque.
            ColorAlphaConverter alphaConverter = new ColorAlphaConverter();
            SolidColorBrush appBarBrush = (SolidColorBrush)alphaConverter.Convert(
                                                            Application.Current.Resources["OBADarkBrush"],
                                                            typeof(SolidColorBrush),
                                                            Application.Current.Resources["OBABackgroundBrush"],
                                                            null
                                                            );

            this.ApplicationBar.BackgroundColor = appBarBrush.Color;

#if SCREENSHOT
            SystemTray.IsVisible = false;
#endif
        }