private void btnSend_Click(object sender, RoutedEventArgs e)
        {
            if (this.isLoged && this.tbInput.Text.Trim() != string.Empty)
            {
                // get messages from mongoDb
                var message = new Message()
                                {
                                    user = new User() { Username = this.username },
                                    Text = this.tbInput.Text,
                                    Date = DateTime.Now
                                };

                this.context.AddMessage(message);

                PrintMessages();
            }
        }
        public void AddMessage(Message message)
        {
            var messages = this.db.GetCollection<Message>("messages");

            messages.Insert(message);
        }