Esempio n. 1
0
 /// <summary>
 /// Show a list of further actions (including copying the guid)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void GUIDButton_Clicked(object sender, EventArgs e)
 {
     Device.BeginInvokeOnMainThread(async() =>
     {
         string formAction = await DisplayActionSheet("Optionen", "Abbrechen", null, "Geometrie entfernen", "GUID Kopieren", "Geometriename editieren");
         if (formAction == "Geometrie entfernen")
         {
             DeleteButton_Clicked(sender, e);
         }
         else if (formAction == "GUID Kopieren")
         {
             GroupedFormRec formRec = ((Button)sender).BindingContext as GroupedFormRec;
             var geom  = formRec.Geom;
             var extId = geom.geometryId;
             ViewModel.CopyGUID(extId);
             await DisplayAlert("BDC GUID kopiert", "", "OK");
         }
         else if (formAction == "Geometriename editieren")
         {
             GroupedFormRec formRec = ((Button)sender).BindingContext as GroupedFormRec;
             var geom          = formRec.Geom;
             string newName    = await DisplayPromptAsync("Geometriename", "Editieren Sie bitte der Geometriename", accept: "OK", cancel: "Abbrechen", initialValue: geom.geometryName, keyboard: Keyboard.Text);
             geom.geometryName = newName;
             geom.timestamp    = DateTime.Now;
             if (geom.status != -1)
             {
                 geom.status = 2;
             }
             ReferenceGeometry.SaveGeometry(geom);
             ViewModel.UpdateRecords();
         }
     });
 }
Esempio n. 2
0
        /// <summary>
        /// Save the temporary geometry
        /// </summary>
        private void SaveNewGeom()
        {
            MessagingCenter.Subscribe <MapPage, string>(this, "GeometryName", (sender, arg) =>
            {
                var geomName = arg as string;
                ReferenceGeometry.SaveGeometry(TempCoordinates, geomName);
                RemoveTempGeometry();
                RefreshShapes();
                MessagingCenter.Unsubscribe <MapPage, string>(this, "GeometryName");
            });
            Mapsui.Geometries.Point point = TempCoordinates[0];
            var coords      = point.ToDoubleArray();
            var coordString = coords[1].ToString("#.000#") + ", " + coords[0].ToString("#.000#");

            MessagingCenter.Send <MapPageVM, string>(this, "RequestGeometryName", coordString);
        }