WP8运行时-如何在C#背后的代码中将内容绑定到电子邮件?
到目前为止,我还没有找到答案。我有一个WP8运行时应用程序,在我的详细信息页面上有以下代码,可以从该应用程序发送电子邮件:WP8运行时-如何在C#背后的代码中将内容绑定到电子邮件?,c#,email,data-binding,windows-runtime,windows-phone-8.1,C#,Email,Data Binding,Windows Runtime,Windows Phone 8.1,到目前为止,我还没有找到答案。我有一个WP8运行时应用程序,在我的详细信息页面上有以下代码,可以从该应用程序发送电子邮件: private async void Email_Click(object sender, RoutedEventArgs e) { // Create your new email message. var em = new EmailMessage(); // Add as much EmailR
private async void Email_Click(object sender, RoutedEventArgs e)
{
// Create your new email message.
var em = new EmailMessage();
// Add as much EmailRecipient in it as you need using the following method.
//em.To.Add(new EmailRecipient("yourname@yourdomain.com"));
em.Subject = "{Binding Description}";
em.Body = "Your email body...";
// You can add an attachment that way.
//em.Attachments.Add(new EmailAttachment(...);
// Show the email composer.
await EmailManager.ShowComposeNewEmailAsync(em);
}
我的问题是,如何使用我的详细信息页面中的绑定作为主题和正文?这样,来自每个详细信息页面的电子邮件将具有不同的电子邮件内容。在示例代码的上下文中,您想将
em.Body
和em.Subject
绑定到什么?我想绑定到我的数据模型-绑定到每个详细信息页面上显示的内容。如果是代码隐藏,您只需要从页面控件获取文本。。。因此em.Subject=SubjectTextBox.Textem.Subject=SubjectTextBox在WP8运行时对我不起作用