void HandleMailFinished(object sender, MFComposeResultEventArgs e)
{
UIApplication.SharedApplication.InvokeOnMainThread(delegate {
if (e.Result == MFMailComposeResult.Sent)
{
// No action required
}
else if (e.Result == MFMailComposeResult.Cancelled)
{
// No action required
}
else if (e.Result == MFMailComposeResult.Failed)
{
INotification notificationService = (INotification)IPhoneServiceLocator.GetInstance().GetService("notify");
if (notificationService != null)
{
notificationService.StartNotifyAlert("Mail Error", "Failed to send mail.\n" + e.Error, "OK");
}
}
else if (e.Result == MFMailComposeResult.Saved)
{
INotification notificationService = (INotification)IPhoneServiceLocator.GetInstance().GetService("notify");
if (notificationService != null)
{
notificationService.StartNotifyAlert("Mail Alert", "Mail saved to draft.", "OK");
}
}
// method reviewed (15 April 2014).
e.Controller.DismissViewController(true, null);
// deprecated --> e.Controller.DismissModalViewController (true);
});
}