<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); }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und vieles mehr. Neu hier? Erstelle ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.