/// <summary> /// Prepare an email to send /// </summary> /// <param name="element">Informations to prepare in the email</param> public static void Email(EmailableObject element) { EmailComposeTask task = new EmailComposeTask { Body = element.Body, Subject = element.Subject }; task.Show(); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { EmailableObject emailableObject = null; if (value is News) { News news = value as News; string url = string.Format(AppResources.WEBSITE_FORMAT, AppResources.PAGE_NEWS, news.Id, news.Url); emailableObject = new EmailableObject { Subject = news.Title, Body = string.Format(AppResources.FORMAT_EMAIL_NEWS, news.ShortText, news.Member.FirstName, news.Member.LastName, url, Environment.NewLine) }; } return emailableObject; }
/// <summary> /// Show the UI to share the news by email /// </summary> /// <param name="news">News transformed in adapted emailable object</param> private void Email(EmailableObject news) { EmailTaskHelper.Email(news); }