我只想用超链接发送(发送)我当前的位置(当你点击它时,它会打开google或bing地图的位置)而不是文字。
答案 0 :(得分:0)
截至目前,EMailComposeTask发送的电子邮件中不支持HTML数据。
您可以参考this discussion。
答案 1 :(得分:0)
简单:使用EmailComposeTask,在文本中只设置maps:11.111,22.222
,其中11.111是纬度,22.222是经度。
Windows Phone电子邮件客户端会看到“maps:”文本并自动将其转换为使用Bing地图应用打开的链接!
答案 2 :(得分:0)
您可以尝试以下方法:
private void StartLocationButton_Click(object sender, RoutedEventArgs e)
{
// The watcher variable should be scoped to the class
if (watcher == null)
{
watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
watcher.MovementThreshold = 20;
watcher.StatusChanged += new
EventHandler<GeoPositionStatusChangedEventArgs>(watcher_StatusChanged);
}
watcher.Start();
}
void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
{
Dispatcher.BeginInvoke(() => MyStatusChanged(e)); //Call BeginInvoke as discussed below…
}
void MyStatusChanged(GeoPositionStatusChangedEventArgs e)
{
if (e.Status == GeoPositionStatus.Ready)
{
var link = String.Format("http://www.google.com/maps?q={0}+{1}",
e.Position.Location.Latitude.ToString("0.000000"),
e.Position.Location.Longitude.ToString("0.000000"));
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.To = "send@mail.com";
emailComposeTask.Body = link;
emailComposeTask.Subject = "GPS";
emailComposeTask.Show();
//Stop the Location Service to conserve battery power.
watcher.Stop();
}
}