private void Btn_Logout_Click(object sender, RoutedEventArgs e) { WebserviceAPI.Logout(); LoginUI loginUI = new LoginUI(); loginUI.Show(); this.Close(); }
private void Btn_Save_Click(object sender, RoutedEventArgs e) { this.Dispatcher.Invoke(new Action(delegate() { WebserviceAPI.LoggedInUserAccount.FirstName = FirstNameInput.Text; WebserviceAPI.LoggedInUserAccount.LastName = LastNameInput.Text; WebserviceAPI.LoggedInUserAccount.UserName = UsernameInput.Text; WebserviceAPI.LoggedInUserAccount.Password = PasswordInput.Password; WebserviceAPI.LoggedInUserAccount.StatusMessage = StatusMessageInput.Text; WebserviceAPI.ChangeUserAccount(); this.Close(); })); }
private async void Btn_Registration_Click(object sender, RoutedEventArgs e) { try { WebserviceAPI.Registrate(FirstNameInput.Text, LastNameInput.Text, UsernameInput.Text, PasswordInput.Password, StatusMessageInput.Text); await this.Dispatcher.Invoke(async() => { MainChatWindow mainChatWindow = new MainChatWindow(); mainChatWindow.Show(); this.Close(); }); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private async void Btn_Login_Click(object sender, RoutedEventArgs e) { try { await WebserviceAPI.LoginAsync(UserNameInput.Text, PasswordInput.Password); await this.Dispatcher.Invoke(async() => { MainChatWindow mainChatWindow = new MainChatWindow(); mainChatWindow.Show(); this.Close(); }); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void MainChatWindow_OnClosed(object sender, EventArgs e) { WebserviceAPI.Logout(); }
private void LoadChats() { ChatList = new ObservableCollection <Model.Chat>(WebserviceAPI.LoadChatList()); ListViewChats.SelectedItem = ChatList.FirstOrDefault(); }
private void LoadContactList() { Contacts = new ObservableCollection <UserAccount>(WebserviceAPI.LoadContactList()); }