private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { AuthServiceClient authClient = new AuthServiceClient(); String sessionId = (String)App.Current.Properties[App.sessionPropertyName]; if (authClient.Logout(sessionId)) { App.Current.Properties[App.sessionPropertyName] = null; App.Current.Properties[App.loginPropertyName] = null; } }