public void TakeScreenshotMap() {
var id = Guid.NewGuid() + ".png";
var media = new Media {
Id = id,
LocalPath = Service.store.GetLocalUrl(Service.Folder, id),
Type = MediaType.Photo,
Title = task.Title
};
Screenshot = Screenshots.SaveImageOfControl(AppState.ViewDef.MapControl, media.LocalPath);
//media.Image = Screenshot as BitmapSource;
foreach (var m in task.AllMedia) {
try { if (File.Exists(m.LocalPath)) File.Delete(m.LocalPath); }
catch (Exception) {}
}
task.AllMedia.Clear();
task.AllMedia.Add(media);
//await Service.store.SaveBytes(id, media.ByteArray);
AppState.TriggerNotification("Map Screenshot saved.");
}