private void Delete(ListBoxItem item)
 {
     if (item != null)
     {
         EMailModal model = item.DataContext as EMailModal;
         if (model != null && DataModel.Instance.EmailList.Contains(model))
         {
             EmailManagerViewModel viewModel = new EmailManagerViewModel();
             viewModel.DeleteEmail(ServiceUtil.Instance.SessionService.Uid, model.MailID);
             if (DataModel.Instance.EmailList.IndexOf(model) >= 0)
             {
                 DataModel.Instance.EmailList.Remove(model);
             }
             this.lstMailID.Items.Remove(item);
             (ServiceUtil.Instance.DataService.INWindow as INWindow).UpdateMailCount();
         }
     }
 }
 private void Setmail(EMailModal eMailModal)
 {
     POP3 pop3 = PopMailFactory.GetPopMail(eMailModal);
     pop3.GetAll();
     EmailManagerViewModel viewModel = new EmailManagerViewModel();
     viewModel.UpdateEmail(ServiceUtil.Instance.SessionService.Uid, eMailModal.MailID, (int)eMailModal.EMailType, eMailModal.Span.ToString(), "");
 }