ContactView LoadChatView(Chat c) { ContactView ctv = new ContactView(40, c.avatar); ctv.Width = 230; ctv.Height = 50; ctv.Name.Content = c.name; if (c.seen_time != "") { TextBlock tb = new TextBlock(); tb.Text = c.body; tb.FontWeight = FontWeights.Bold; tb.TextWrapping = TextWrapping.NoWrap; ctv.Message.Content = tb; } else { ctv.Message.Content = c.body; } ctv.Time.Content = c.send_time; ctv.IsGroup = c.is_group; ctv.ChatId = c.chat_id; ctv.MouseDown += Ctv_MouseDown; return(ctv); }
private void Ctv_MouseDown(object sender, MouseEventArgs e) { ContactView cvw = (ContactView)sender; ChatWindow c = new ChatWindow(cvw.ChatId, cvw.Name.Content.ToString()); c.Owner = this; c.Show(); }
ContactView LoadContactView(Contact c) { ContactView ctv = new ContactView(40, c.avatar); ctv.Width = 230; ctv.Height = 50; ctv.Name.Content = c.name; ctv.ChatId = c.chat_id; ctv.MouseDown += Ctv_MouseDown; return(ctv); }