public SiniestroDetailPage(SiniestrosModel siniestro) { InitializeComponent(); BindingContext = new SiniestroDetailViewModel(siniestro); lstViewAsegurados.SelectedItem = siniestro.Asegurado; }
public SiniestroMapPage(SiniestrosModel siniestroSelected) { InitializeComponent(); MapSiniestro.MoveToRegion( MapSpan.FromCenterAndRadius( new Position(Double.Parse(siniestroSelected.Latitude), Double.Parse(siniestroSelected.Longitude)), Distance.FromMiles(.5) )); string imagePath = new ImageService().SaveImageFromBase64(siniestroSelected.FotoSiniestro, siniestroSelected.IdSiniestro); siniestroSelected.FotoSiniestro = imagePath; MapSiniestro.Siniestros = siniestroSelected; MapSiniestro.Pins.Add( new Pin { Type = PinType.Place, Label = siniestroSelected.Asegurado.Nombre, Position = new Position(Double.Parse(siniestroSelected.Latitude), Double.Parse(siniestroSelected.Longitude)) } ); NombreAjustador.Text = siniestroSelected.NombreAjustador; Fecha.Text = siniestroSelected.TiempoSiniestro.ToString(); Asegurado.Text = siniestroSelected.Asegurado.Nombre; }
public MarkerWindow(SiniestrosModel Siniestros) { this.InitializeComponent(); MarkerWindowImage.Source = new BitmapImage(new Uri(Siniestros.FotoSiniestro)); MarkerWindowTitle.Text = Siniestros.NombreAjustador; MarkerWindowNotes.Text = Siniestros.Asegurado.Nombre; }
protected override void OnElementChanged(ElementChangedEventArgs <Map> e) { base.OnElementChanged(e); if (e.OldElement != null) { nativeMap.MapElementClick -= OnMapElementClick; nativeMap.Children.Clear(); markerWindow = null; nativeMap = null; } if (e.NewElement != null) { this.Siniestros = (e.NewElement as CustomMap).Siniestros; var formsMap = (CustomMap)e.NewElement; nativeMap = Control as MapControl; nativeMap.Children.Clear(); // ay lmao nativeMap.MapElementClick += OnMapElementClick; var snPosition = new BasicGeoposition { Latitude = Double.Parse(Siniestros.Latitude), Longitude = Double.Parse(Siniestros.Longitude) }; var snPoint = new Geopoint(snPosition); var mapIcon = new MapIcon(); mapIcon.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///pin.png")); mapIcon.CollisionBehaviorDesired = MapElementCollisionBehavior.RemainVisible; mapIcon.Location = snPoint; mapIcon.NormalizedAnchorPoint = new Windows.Foundation.Point(0.5, 1.0); nativeMap.MapElements.Add(mapIcon); } }