private static readonly DependencyProperty AssociatedLayerIDProperty = DependencyProperty.RegisterAttached("AssociatedLayerID", typeof(string), typeof(Graphic), null);
FeatureLayer featureLayer = sender as FeatureLayer; foreach (Graphic graphic in featureLayer) { graphic.SetValue(AssociatedLayerIDProperty, featureLayer.ID); }
string associatedField = (sender as FrameworkElement).GetValue(AssociatedLayerIDProperty) as string;
<esri:LineSymbol x:Key="DefaultLineSymbol"> <esri:LineSymbol.ControlTemplate> <ControlTemplate> <Grid> <Path x:Name="Element" Stroke="{Binding Symbol.Color}" StrokeThickness="{Binding Symbol.Width}" Tag="{Binding Path=(my:MyClass.LayerId)}"/> </Path> </Grid> </ControlTemplate> </esri:LineSymbol.ControlTemplate> </esri:LineSymbol>
{Binding Layers[1].ID, ElementName=MyMap}
<esri:LineSymbol x:Key="DefaultLineSymbol" x:Shared="False"> <esri:LineSymbol.ControlTemplate> <ControlTemplate> <Grid> <Path x:Name="Element" Stroke="{Binding Symbol.Color}" StrokeThickness="{Binding Symbol.Width}"/> <Path x:Name="TouchArea" Stroke="Transparent" StrokeThickness="10" Data="{Binding Data, ElementName=Element}" > <i:Interaction.Triggers> <gti:TouchTrigger HandleTouches="True" > <gti:PathMapTipAction Attributes="{Binding Attributes}" LayerId={Binding Path=(my:MyClass.LayerId)} /> </gti:TouchTrigger> </i:Interaction.Triggers> </Path> </Grid> </esri:LineSymbol.ControlTemplate> </esri:LineSymbol>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.