Exemple #1
0
        private async void GetLastChangesBtn_Click(object sender, RoutedEventArgs e)
        {
            MyProgressRing.IsActive     = true;
            GetLastChangesBtn.IsEnabled = false;
            try
            {
                await StorageRepos.GetData();

                LastChangeAtTextBlock.Text = Windows.Storage.ApplicationData.Current.RoamingSettings.Values[StorageRepos.LastUpdateAt].ToString();
                StateTextBlock.Text        = "Up to date ";
                StateTextBlock.Foreground  = new SolidColorBrush(Colors.DarkCyan);
            }
            catch (Exception)
            {
                StateTextBlock.Text       = "failed to get update !";
                StateTextBlock.Foreground = new SolidColorBrush(Colors.Salmon);
            }
            MyProgressRing.IsActive = false;

            await Task.Delay(4000);

            StateTextBlock.Text = "";

            GetLastChangesBtn.IsEnabled = true;
        }
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                await StorageRepos.GetData();

                myFrame1.Navigate(typeof(HomePage));
            }
            catch (Exception) { }
        }