private void c_SettingsLoaded(object sender, SettingsProvidedEventArgs e)
 {
     SetSettings(e);
     this.Visibility = Visibility.Visible;
     this.Show();
     MessageLog.LogSystemMessage("Welcome to UDP Chat!");
 }
 private void SetSettings(SettingsProvidedEventArgs e)
 {
     try
     {
         chat = new UDPChat(e.Address, e.RPort, e.LPort, e.Name);
         MessageLog.LogUpdated += c_LogUpdated;
     }
     catch (Exception ex) { MessageLog.LogSystemMessage("Error!" + ex.Message); }
 }
        private void SendButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                chat.SendMessage(SendTextBox.Text);

                Dispatcher.Invoke(new Action(() =>
                {
                    SendTextBox.Text = "";
                }));
            }
            catch (Exception ex) { MessageLog.LogSystemMessage("Error!" + ex.Message); }
        }