private void logout_Click(object sender, RoutedEventArgs e) { try { // Delete the cache SyncContextInstance.Context.ClearCache(); } finally { SettingsViewModel.Instance.UserId = Guid.Empty; SettingsViewModel.Instance.UserName = null; SyncContextInstance.ClearContext(); SettingsViewModel.SaveSettingsFile(); NavigationService.Navigate(new Uri("/Bootstrapview.xaml", UriKind.Relative)); } }
void CacheController_RefreshCompleted(object sender, Microsoft.Synchronization.ClientServices.RefreshCompletedEventArgs e) { if (e.Error != null) { Dispatcher.BeginInvoke(() => { this.loadErrorTextBlk.Text = e.Error.Message; this.loadErrorTextBlk.Visibility = System.Windows.Visibility.Visible; }); } else { SyncContextInstance.Context.CacheController.RefreshCompleted -= CacheController_RefreshCompleted; SyncContextInstance.AddStats(e.Statistics, e.Error); Dispatcher.BeginInvoke(() => this.popupPanel.IsOpen = false); } StopTimer(); }