<Button x:Name="AddNewRow" Margin="5,0" Style="{StaticResource MenuButtonStyle}" Click="addrowButton_Click"> <TextBlock Margin="5" Text="Add a new record" VerticalAlignment="Center"/> </Button>
private void addrowButton_Click(object sender, RoutedEventArgs e) { var g = new Graphic(); if (l != null && l.LayerInfo != null && l.LayerInfo.Fields != null) { foreach (var f in l.LayerInfo.Fields) { // if you want to prepopulate fields add that info here: something like - //g.Attributes["DateTime"] = DateTime.UtcNow; } } else { //g.Attributes["DateTime"] = DateTime.UtcNow; } l.Graphics.Add(g); }
Ingelogde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Maak gratis een account aan.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.