private void linemessage(MobileServiceCollection<ChatMessage, ChatMessage> items)
 {
     //throw new NotImplementedException();
     for (int i = 0; i < items.Count; i++)
     {
         var oldChat = new ChatMessage();
         oldChat.From = items[i].From;
         oldChat.DateTime = items[i].DateTime;
         oldChat.Content = items[i].Content;
         TextBoxChatMessages.Text += Environment.NewLine + oldChat.ToString();
     }
 }
        private async void InsertChatMessage(ChatMessage message)
        {
            try
            {
                TextBoxChatMessages.Text += string.Format("{0}\n", message.ToString());
                //message = output;
                await chatTable.InsertAsync(message);
                ReadyForNextMessage();
            }
            catch
            {

            }
        }
        public async void readMessage()
        {
            try
            {
                var items = await chatTable.ToCollectionAsync();
                var temp = items;

                for (var i = 0; i < items.Count; i++)
                {
                    var oldChat = new ChatMessage();
                    oldChat.From = items[i].From;
                    oldChat.DateTime = items[i].DateTime;
                    oldChat.Content = items[i].Content;
                    TextBoxChatMessages.Text += Environment.NewLine + oldChat.ToString();
                }
            }
            catch
            {

            }
        }
        private void ButtonContent_Click_1(object sender, RoutedEventArgs e)
        {
            string[] badWords = new[] { "f**k", "f u c k","sex", "s e x", "bobo", "b o b o", "f.u.c.k", "s.e.x", "b.o.b.o",
            "puta", "tanga", "p u t a", "t a n g a", "p.u.t.a", "t.a.n.g.a", "tangina", "t.a.n.g.i.n.a", "putangina",
            "p.u.t.a.n.g.i.n.a"};
            string input = TextBoxMessage.Text;
            string output = Filter(input, badWords);

            if (!string.IsNullOrWhiteSpace(output))
            {
                var chatMessage = new ChatMessage()
                {
                    From = name,
                    Content = output.Trim(),
                    //DateTime = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"),
                    DateTime = DateTime.Now.ToString(),
                };
                InsertChatMessage(chatMessage);
            }
            
            ReadyForNextMessage();
            TextBoxMessage.Text = "";
        }