private void logout_btn_Click(object sender, RoutedEventArgs e) { Notebook.notebook.RemoveRange(0, Notebook.notebook.Count); if (Evennote.OfflineMode) { (Application.Current.MainWindow as MainWindow).ChangePage("pages/login_page.xaml"); System.IO.File.Delete(Evennote.ConfigFile); Evennote.OfflineMode = false; return; } Evennote.user.online = false; (Application.Current.MainWindow as MainWindow).ChangePage("pages/login_page.xaml"); Evennote.AutoLogin = false; System.IO.File.Delete(Evennote.ConfigFile); MyDataBase.ConnectToDB(); MyDataBase.ChangeOnlineStatus(Evennote.user.id); MyDataBase.CloseConnectToDB(); Evennote.user = null; }