Beispiel #1
0
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            var deferral = taskInstance.GetDeferral();

            await TileAndToast.Show();

            deferral.Complete();
        }
        private async void RegisterTileTask()
        {
            IsLoading = true;

            // 重新注册后台任务
            BackgroundTaskRegistration.AllTasks.ForEach(t =>
            {
                if (t.Value.Name == App.LIVETILETASK)
                {
                    t.Value.Unregister(true);
                }
            });
            await App.RegisterLiveTileTask();

            await TileAndToast.Show(true);

            IsLoading = false;
        }