コード例 #1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            #region
            try
            {
                //注册后台任务
                RegisterBackgroundTask();
                //读取已下载的文件
                DownloadHelper2.LoadDowned();
                //加载分区
                ApiHelper.SetRegions();
                //加载直播头衔
                LiveRoom.GetTitleItems();
                //ApiHelper.SetEmojis();
            }
            catch (Exception)
            {
            }
            #endregion

            m = e.Parameter as StartModel;
            await Task.Delay(1000);

            this.Frame.Navigate(typeof(MainPage), m);
        }
コード例 #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            #region
            try
            {
                //注册后台任务
                RegisterBackgroundTask();
                //读取已下载的文件
                DownloadHelper2.LoadDowned();
                //加载分区
                ApiHelper.SetRegions();
                //加载直播头衔
                LiveRoom.GetTitleItems();
                //ApiHelper.SetEmojis();
            }
            catch (Exception)
            {
            }
            #endregion

            m              = e.Parameter as StartModel;
            timer          = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.Tick    += Timer_Tick;
            timer.Start();
            if (m.StartType == StartTypes.None && SettingHelper.Get_LoadSplash())
            {
                // await GetResults();
            }
            else
            {
                // await Task.Delay(2000);
                // this.Frame.Navigate(typeof(MainPage), m);
            }
        }
コード例 #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            #region
            try
            {
                //注册后台任务
                RegisterBackgroundTask();
                // 下面三个同时
                await Task.WhenAll(
                    //读取已下载的文件
                    DownloadHelper2.LoadDowned(),
                    //加载分区
                    ApiHelper.SetRegions(),
                    //加载直播头衔
                    LiveRoom.GetTitleItems());

                //ApiHelper.SetEmojis();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            #endregion

            m = e.Parameter as StartModel;

            await Task.Delay(300);

            Frame.Navigate(typeof(MainPage), m);
        }
コード例 #4
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            #region
            switch (new Random().Next(1, 4))
            {
            case 1:
                txt_Load.Text = "爱国、敬业、诚信、友善";
                break;

            case 2:
                txt_Load.Text = "富强、民主、文明、和谐";
                break;

            case 3:
                txt_Load.Text = "自由、平等、公正、法治";
                break;

            default:
                break;
            }
            try
            {
                //注册后台任务
                RegisterBackgroundTask();
                //读取已下载的文件
                DownloadHelper2.LoadDowned();
                //加载分区
                ApiHelper.SetRegions();
                //加载直播头衔
                LiveRoom.GetTitleItems();
                //ApiHelper.SetEmojis();
            }
            catch (Exception)
            {
            }
            #endregion

            m              = e.Parameter as StartModel;
            timer          = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.Tick    += Timer_Tick;
            timer.Start();
            if (m.StartType == StartTypes.None && SettingHelper.Get_LoadSplash())
            {
                // await GetResults();
            }
            else
            {
                // await Task.Delay(2000);
                // this.Frame.Navigate(typeof(MainPage), m);
            }
        }