<Button x:Name="tellAFriendButton" Width="352" Height="47"
Click="OnClickTellAFriendButton"
Style="{StaticResource TellAFriendButtonStyle}" Margin="174,241,274,0"
Template="{StaticResource TellAFriendControlTemplate}">
</Button>
In c#:
private void OnClickTellAFriendButton(object aSender,
System.Windows.RoutedEventArgs aRoutedEventArgs)
{
var emailAddressChooserTask = new EmailAddressChooserTask();
emailAddressChooserTask.Show();
emailAddressChooserTask.Completed +=
EmailAddressChooserTaskCompleted;
}
void EmailAddressChooserTaskCompleted(object aSender,
EmailResult aEmailResult)
{
var emailComposeTask = new EmailComposeTask();
emailComposeTask.To = aEmailResult.Email;
emailComposeTask.Body = ComposeEmailBody();
emailComposeTask.Show();
}
Where composeEmailBody() is a function that returns a string, you can implement it in your own needs.
沒有留言:
張貼留言