private void btnNewEmail_Click(object sender, RoutedEventArgs e) { sendMail = new SendMail(); myController = new mailSystemUC(); DockPanel.SetDock(myController, Dock.Top); sendMail.bottomDockPanel.Children.Add(myController); sendMail.Show(); }
private void listView_DoubleClick(object sender, MouseButtonEventArgs e) { MyItem item = (MyItem)(sender as ListView).SelectedItem; SendMail viewer = new SendMail(); viewer.Show(); mailSystemUC myController = new mailSystemUC(); DockPanel.SetDock(myController, Dock.Top); viewer.bottomDockPanel.Children.Add(myController); if (item != null) { for (int i = 0; i < allMails.Count; i++) { if (item.id == allMails[i].id) { viewer.viewEmail(allMails[i], myController); } } } }
public void viewEmail(EmailItem myEmail, mailSystemUC myController) { recepientAddress.IsReadOnly = true; ccAddress.IsReadOnly = true; bccAddress.IsReadOnly = true; emailTitle.IsReadOnly = true; myController.emailContent.IsReadOnly = true; myController.viewEmail(myEmail); myController.textEditor.Visibility = Visibility.Hidden; sendOptions.Visibility = Visibility.Hidden; btnAttach.Visibility = Visibility.Hidden; btnCancelEmail.Visibility = Visibility.Hidden; btnSendEmail.Visibility = Visibility.Hidden; for (int i = 0; i < myEmail.recipients.Count; i++) { if (myEmail.recipients[i].role == "to") { recepientAddress.Text += myEmail.recipients.ElementAt(i).address + ", "; } else if (myEmail.recipients[i].role == "cc") { ccAddress.Text += myEmail.recipients[i].address + ", "; } else if (myEmail.recipients[i].role == "bcc") { bccAddress.Text += myEmail.recipients[i].address + ", "; } } emailTitle.Text = myEmail.title; for (int i = 0; i < myEmail.attachments.Count; i++) { attachmentList.Items.Add(new MyItem { icon = myEmail.attachments[i], path = myEmail.attachments[i] }); } }