Beispiel #1
0
 public ViewModel_Maps(CompleteAlertModel alerta)
 {
     Alert = alerta;
     try
     {
         if (alert.Ubication_List.Count > 0)
         {
             var query = from x in alert.Ubication_List
                         select new Pin {
                 Position = new Position(x.Latitude, x.Longitude), Label = ""
             };
             foreach (var pin in query)
             {
                 PinList.Add(pin);
             }
             Position = PinList[0].Position;
         }
         else
         {
             Position = new Position(alert.Latitude, alert.Longitude);
             PinList.Add(new Pin {
                 Position = new Position(alert.Latitude, alert.Longitude), Label = ""
             });
         }
     }
     catch (System.Exception ex)
     {
         DependencyService.Get <IMessage>().LongAlert(ex.Message);
     }
 }
Beispiel #2
0
 public View_Maps(CompleteAlertModel model)
 {
     InitializeComponent();
     BindingContext = new ViewModel_Maps(model);
 }