<esri:SimpleRenderer x:Key="MyRenderer"> <esri:MarkerSymbol OffsetX="10" OffsetY="10"> <esri:MarkerSymbol.ControlTemplate> <ControlTemplate> <StackPanel> <TextBlock Text="{Binding Attributes[CITY_NAME]}" /> </StackPanel> </ControlTemplate> </esri:MarkerSymbol.ControlTemplate> </esri:MarkerSymbol> </esri:SimpleRenderer> <!--more code goes here--> <esri:GraphicsLayer ID="MyGraphicsLayer" Renderer="{StaticResource MyRenderer}"/>
private void FeatureLayer_UpdateCompleted(object sender, EventArgs e) { var source = sender as FeatureLayer; var target = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; foreach (var g in source.Graphics) { var graphic = new Graphic() { Geometry = g.Geometry }; foreach (var attribute in g.Attributes) graphic.Attributes[attribute.Key] = attribute.Value; target.Graphics.Add(graphic); } }
<StackPanel x:Name="MyPanel" Visibility="Collapsed" ...> <TextBlock x:Name="MyTextblock" Text="" /> </StackPanel>
MyTextblock.Text = "The text to display"; MyPanel.Visibility = Visibility.Visible;
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.