<Border CornerRadius="10" BorderBrush="#FF222957" BorderThickness="3" Margin="0,0,15,15"> <Border.Background> <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188"> <GradientStop Color="#FFD1DFF2"/> <GradientStop Color="#FF0088FF" Offset="0.946"/> </LinearGradientBrush> </Border.Background> <Border.Effect> <DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" /> </Border.Effect> <StackPanel Margin="7"> <TextBlock x:Name="MyCityName" Loaded="TextBlock_Loaded" Text="{Binding [CITY_NAME]}" FontWeight="Bold" Foreground="Black" /> <StackPanel Orientation="Horizontal"> <TextBlock Text="Population: " Foreground="Black" /> <TextBlock Text="{Binding [POP1990]}" Foreground="Black" /> </StackPanel> </StackPanel> </Border>
{ InitializeComponent(); FeatureLayer layer = this.MyMap.Layers["CitiesFeatureLayer"] as FeatureLayer; var mapTip = layer.MapTip; if (this.MyCityName == null) { var name = (((mapTip as Border).Child as StackPanel).Children[0] as TextBlock).Name; System.Diagnostics.Debug.WriteLine("This is one way of accessing this control '{0}'", name); } } private void TextBlock_Loaded(object sender, System.Windows.RoutedEventArgs e) { TextBlock tb = sender as TextBlock; if (this.MyCityName == null) System.Diagnostics.Debug.WriteLine("Another way of accessing this control '{0}'", tb.Name); }
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.