public void Save(QuickMailTemplate template)
 {
     Templates.Insert(0, template);
 }
Exemple #2
0
        private void OnSave(object sender, EventArgs e)
        {
            QuickMailTemplate template;

            if (TemplateId == null)
            {

                template = new QuickMailTemplate
                {
                    Id = Guid.NewGuid(),
                    Subject = Subject.Text,
                    Body = Body.Text
                };

                storage.Save(template);
            }
            else
            {
                template = storage.GetItems()
                    .Single(t => t.Id == TemplateId);

                template.Subject = Subject.Text;
                template.Body = Body.Text;
            }

            storage.SaveChanges();

            NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }
 public void Delete(QuickMailTemplate template)
 {
     Templates.Remove(template);
 }