private void Submit() { if (!PointA.HasValue() && !PointB.HasValue()) { base.ShowPopup(CustomPopupMessageType.Error, AppResources.MapPointSelectionNoPointsPlacedPopupText, AppResources.CustomPopupGenericOkMessage, null); return; } if (fromWhereTo) { WhereToMessage.Send(new WhereToModel(PointA.Name, PointB.Name, PointA.Location, PointB.Location)); NavigationService.GoBack(); } else { if (PointA.HasValue() && PointB.HasValue()) { NavigationService.NavigateTo(string.Format("/Views/WhereTo.xaml?startname={0}&endname={1}&startlat={2}&startlon={3}&endlat={4}&endlon={5}", PointA.Name, PointB.Name, PointA.Location.Latitude.ToString(CultureInfo.InvariantCulture), PointA.Location.Longitude.ToString(CultureInfo.InvariantCulture), PointB.Location.Latitude.ToString(CultureInfo.InvariantCulture), PointB.Location.Longitude.ToString(CultureInfo.InvariantCulture))); } else if (PointA.HasValue() && !PointB.HasValue()) { NavigationService.NavigateTo(string.Format("/Views/WhereTo.xaml?startname={0}&startlat={1}&startlon={2}", PointA.Name, PointA.Location.Latitude.ToString(CultureInfo.InvariantCulture), PointA.Location.Longitude.ToString(CultureInfo.InvariantCulture))); } else if (!PointA.HasValue() && PointB.HasValue()) { NavigationService.NavigateTo(string.Format("/Views/WhereTo.xaml?endname={0}&endlat={1}&endlon={2}", PointB.Name, PointB.Location.Latitude.ToString(CultureInfo.InvariantCulture), PointB.Location.Longitude.ToString(CultureInfo.InvariantCulture))); } } }
private void PointBClick() { if (this.isPointA) { PointB.Select(); this.isPointA = false; PointA.Deselect(); if (PointB.HasValue()) { if (PointB.Station == null && PointB.CustomPoint == null) { SelectedSearchItemForView = PointB.SearchItem; SelectedStationVisibility = Visibility.Collapsed; SelectedSearchItemVisibility = Visibility.Visible; SelectedCustomPointVisibility = Visibility.Collapsed; } else if (PointB.SearchItem == null && PointB.CustomPoint == null) { SelectedStationForView = PointB.Station; SelectedSearchItemVisibility = Visibility.Collapsed; SelectedStationVisibility = Visibility.Visible; SelectedCustomPointVisibility = Visibility.Collapsed; } else { SelectedCustomPointForView = PointB.CustomPoint; SelectedSearchItemVisibility = Visibility.Collapsed; SelectedStationVisibility = Visibility.Collapsed; SelectedCustomPointVisibility = Visibility.Visible; } PointB.Show(); } else { PointB.Hide(); SelectedStationVisibility = Visibility.Collapsed; SelectedSearchItemVisibility = Visibility.Collapsed; SelectedCustomPointVisibility = Visibility.Collapsed; } } }