Ejemplo n.º 1
0
        public MainPage()
        {
            InitializeComponent();
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                TitleBlock.Visibility = Visibility.Collapsed;
            }
            Current = this;
            Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
            MainFrame.Navigate(typeof(NowWeatherPage), this);
            license = new License.License();
            var t = ThreadPool.RunAsync(async(w) =>
            {
                var c = Convert.ToUInt64(RoamingSettingsHelper.ReadSettingsValue("MeetDataSourceOnce"));
#if BETA
                if (true)
                {
                    RoamingSettingsHelper.WriteSettingsValue("MeetDataSourceOnce", SystemInfoHelper.GetPackageVersionNum());
                    await Task.Delay(1000);
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(() =>
                    {
                        VersionText.Text           = SystemInfoHelper.GetPackageVer();
                        UpdateTitle.Text           = "BETA Version Note";
                        UpdateDetailText.Text      = "You are in BETA version NOW, all the features are unlocked and you should be clear what you are doing. You can contact with developers to quit BETA version. This BETA version is unstable and you MUST be aware of all the consequence that may arise.";
                        UpdateDetailText.FontSize  = 18;
                        UpdateLogButton.Visibility = Visibility.Collapsed;
                        ShowUpdateDetail();
                    }));
                }
#else
                if (c < SystemInfoHelper.GetPackageVersionNum())

                //if (true)
                {
                    RoamingSettingsHelper.WriteSettingsValue("MeetDataSourceOnce", SystemInfoHelper.GetPackageVersionNum());
                    await Task.Delay(1000);
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(() =>
                    {
                        VersionText.Text = SystemInfoHelper.GetPackageVer();
                        ShowUpdateDetail();
                    }));
                }
#endif
                else
                {
                    HideUpdateButton_Click(null, null);
                }
            });
        }