Inheritance: PhoneApplicationFrame
Beispiel #1
0
        public App()
        {
            UnhandledException += App_UnhandledException;

            InitializeComponent();

            RootFrame = new TransitionFrame();
            RootFrame.Navigated += RootFrame_Navigated;
            RootFrame.Obscured += RootFrame_Obscured;
            RootFrame.Unobscured += RootFrame_Unobscured;

            Settings = new AppSettings(IsolatedStorageSettings.ApplicationSettings);
            Storage = new AppStorage(IsolatedStorageSettings.ApplicationSettings);

            if (Storage.Signals == null)
            {
                Storage.Signals = new SignalCollection
                {
                    new MorseCodeSignal("SOS", "SOS", 3000),
                    new FlashSignal("Beacon", 100, 3000)
                };
            }

            if (Settings.DisableApplicationIdleDetection)
            {
                PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
Beispiel #2
0
        public App()
        {
            UnhandledException += App_UnhandledException;

            InitializeComponent();

            RootFrame = new TransitionFrame();
            RootFrame.Navigated += RootFrame_Navigated;
            RootFrame.Obscured += RootFrame_Obscured;
            RootFrame.Unobscured += RootFrame_Unobscured;

            Settings = new AppSettings(IsolatedStorageSettings.ApplicationSettings);

            if (Settings.DisableApplicationIdleDetection)
            {
                PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();
            RootFrame = new TransitionFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
Beispiel #4
0
        protected override PhoneApplicationFrame CreatePhoneApplicationFrame()
        {
            var frame = new TransitionFrame();

            TiltEffect.SetIsTiltEnabled(frame, true);

            return frame;
        }
Beispiel #5
0
        // Fügen Sie keinen zusätzlichen Code zu dieser Methode hinzu
        private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;

            // Frame erstellen, aber noch nicht als RootVisual festlegen. Dadurch kann der Begrüßungsbildschirm
            // aktiv bleiben, bis die Anwendung bereit für das Rendern ist.
            RootFrame = new TransitionFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Navigationsfehler behandeln
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Sicherstellen, dass keine erneute Initialisierung erfolgt
            phoneApplicationInitialized = true;
        }
Beispiel #6
0
        // Do not add any additional code to this method
        private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;

            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            RootFrame = new TransitionFrame() {
                Background = new SolidColorBrush(Colors.Transparent)
            };
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;
        }
Beispiel #7
0
        // Do not add any additional code to this method
        private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;

            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            RootFrame = new TransitionFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Global loading
            GlobalLoading.Instance.Initialize(RootFrame);

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;
        }
Beispiel #8
0
        // Do not add any additional code to this method
        private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
        {
            // Set the root visual to allow the application to render
            if (RootVisual != RootFrame)
                RootVisual = new TransitionFrame();

            // Remove this handler since it is no longer needed
            RootFrame.Navigated -= CompleteInitializePhoneApplication;
        }
Beispiel #9
0
		private void InitializePhoneApplication()
		{
			if (phoneApplicationInitialized)
				return;

			// RootFrame = new PhoneApplicationFrame();
			RootFrame = new TransitionFrame(); 
			RootFrame.Navigated += CompleteInitializePhoneApplication;

			RootFrame.NavigationFailed += RootFrame_NavigationFailed;
			phoneApplicationInitialized = true;
		}
 private void InitializePhoneApplication()
 {
     if (!this.phoneApplicationInitialized)
     {
         TransitionFrame frame = new TransitionFrame
         {
             Language = XmlLanguage.GetLanguage(AppSetting.Instance.DisplayLanguage)
         };
         this.RootFrame = frame;
         this.RootFrame.Navigated += new NavigatedEventHandler(this.CompleteInitializePhoneApplication);
         this.RootFrame.NavigationFailed += new NavigationFailedEventHandler(this.RootFrame_NavigationFailed);
         this.phoneApplicationInitialized = true;
         GlobalIndicator.Instance.Initialize(this.RootFrame);
     }
 }
Beispiel #11
0
        private void InitializePhoneApplication()
        {
            if (_phoneApplicationInitialized)
            {
                return;
            }

            RootFrame = new TransitionFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;
            RootFrame.Navigating += RootFrame_Navigating;
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;
            RootFrame.Navigated += CheckForResetNavigation;

            _phoneApplicationInitialized = true;
        }
Beispiel #12
0
        // このメソッドに新たなコードを追加しないでください
        private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;

            // フレームを作成しますが、まだ RootVisual に設定しないでください。これによって、アプリケーションがレンダリングできる状態になるまで、
            // スプラッシュ スクリーンをアクティブなままにすることができます。
            RootFrame = new TransitionFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // ナビゲーション エラーを処理します
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // 再初期化しないようにします
            phoneApplicationInitialized = true;
        }
Beispiel #13
0
        // Do not add any additional code to this method
        private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;

            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            // RootFrame = new PhoneApplicationFrame();
            RootFrame = new Microsoft.Phone.Controls.TransitionFrame();

            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Assign the URI-mapper class to the application frame.
            RootFrame.UriMapper = new PodcatcherSchemeURIMapper();

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;

            try
            {
                PeriodicTask backgroundTask = null;
                backgroundTask = ScheduledActionService.Find(BGTASK_NEW_EPISODES) as PeriodicTask;
                if (backgroundTask != null)
                {
                    ScheduledActionService.Remove(backgroundTask.Name);
                }

                // Start our background agent.
                backgroundTask = new PeriodicTask(BGTASK_NEW_EPISODES);
                backgroundTask.Description = "Podcatcher's background task that checks if new episodes have arrived for pinned subscriptions";

                ScheduledActionService.Add(backgroundTask);
            #if DEBUG
                // Disable lock screen.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

                // Start background agent updates.
                Debug.WriteLine("Adding background service....");
                ScheduledActionService.LaunchForTest(BGTASK_NEW_EPISODES, TimeSpan.FromSeconds(10));

            #endif
            }
            catch (InvalidOperationException e)
            {
                if (e.Message.Contains("BNS Error: The action is disabled"))
                {
                    Debug.WriteLine("Background agent disabled.");
                }
            }
            catch (Exception) { /* In case we get some other scheduler related exception. But we are not interested. */ }
        }
Beispiel #14
0
        // 请勿向此方法中添加任何其他代码
        private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;

            // 创建框架但先不将它设置为 RootVisual;这允许初始
            // 屏幕保持活动状态,直到准备呈现应用程序时。
            RootFrame = new TransitionFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;
            RootFrame.Navigating += RootFrame_Navigating;
            RootFrame.Dispatcher.BeginInvoke(BuildDefaultSettings);
            // Assign the URI-mapper class to the application frame.
            RootFrame.UriMapper = new AssociationUriMapper();

            // 处理导航故障
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // 确保我们未再次初始化
            phoneApplicationInitialized = true;
        }
Beispiel #15
0
        // 请勿向此方法中添加任何其他代码
        private void InitializePhoneApplication() {
            if (phoneApplicationInitialized)
                return;

            // 创建框架但先不将它设置为 RootVisual;这允许初始
            // 屏幕保持活动状态,直到准备呈现应用程序时。
            RootFrame = new TransitionFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // 处理导航故障
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // 确保我们未再次初始化
            phoneApplicationInitialized = true;
        }
Beispiel #16
0
        // Do not add any additional code to this method
        private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;

            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            RootFrame = new TransitionFrame();
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Handle reset requests for clearing the backstack
            RootFrame.Navigated += CheckForResetNavigation;

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;
        }
Beispiel #17
0
        // Do not add any additional code to this method
        private void InitializePhoneApplication()
        {
            if (phoneApplicationInitialized)
                return;

            // Create the frame but don't set it as RootVisual yet; this allows the splash
            // screen to remain active until the application is ready to render.
            var tf = new Microsoft.Phone.Controls.TransitionFrame();
            RootFrame = tf;
            RootFrame.Navigated += CompleteInitializePhoneApplication;

            // Handle navigation failures
            RootFrame.NavigationFailed += RootFrame_NavigationFailed;

            // Ensure we don't initialize again
            phoneApplicationInitialized = true;
        }