private async void addNewPointFromShareAsync(string routeName) { if (_sharePointMessage != null) { ViewRoutePoint newPoint = new ViewRoutePoint(_routeItem.RouteId, string.Empty); newPoint.Version++; if (string.IsNullOrEmpty(_sharePointMessage.Subject)) { string name = _sharePointMessage.Description.Substring(0, 15); if (_sharePointMessage.Description.Length > 15) { name += "..."; } newPoint.Name = name; } else { newPoint.Name = _sharePointMessage.Subject; } newPoint.Description = _sharePointMessage.Description; CustomGeocoding geo = new CustomGeocoding(newPoint.Description); if (await geo.GetCoordinatesAsync()) { newPoint.Longitude = geo.Longtitude; newPoint.Latitude = geo.Latitude; } if (newPoint.Save()) { _sharePointMessage = null; } } }
public RoutesPage(ShareFromGoogleMapsMessage msg) { InitializeComponent(); _vm = new RoutesViewModel() { Navigation = this.Navigation }; _vm.AddSharedPoint(msg); BindingContext = _vm; }
internal void AddSharedPoint(ShareFromGoogleMapsMessage msg) { _sharePointMessage = msg; }