// Constructor public MainPage() { InitializeComponent(); Browser.Width = Application.Current.Host.Content.ActualWidth; // Overlay this.popup = new Popup(); LayoutRoot.Children.Add(popup); overlay = new site2App.WP8.Overlay(); this.popup.Child = overlay; _webConfig = ((App)Application.Current).WebConfig; // Handle orientation changes OrientationChanged += MainPage_OrientationChanged; PhoneApplicationService.Current.Activated += Current_Activated; PhoneApplicationService.Current.Deactivated += Current_Deactivated; PhoneApplicationService.Current.Closing += Current_Closing; try { _currentUrl = (Uri)(userSettings["deactivatedUrl"]); } catch (System.Collections.Generic.KeyNotFoundException) { } catch (Exception exn) { Debug.WriteLine(exn.ToString()); } }