My question now is it possible to set the MapTips for FeatureLayers using code behind?
TextBlock txtBlock = new TextBlock(); txtBlock.SetBinding(TextBlock.TextProperty, new Binding("[POP1990]")); graphicLayer.MapTip = new Border() { Child = txtBlock, Background = new SolidColorBrush(Colors.White) };
Or is there an easier way to achieve this using XAML and code behind?
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" > <sys:String x:Key="baseLayerUrl">http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer</sys:String> <sys:String x:Key="featureLayerUrl">http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2</sys:String> </ResourceDictionary>
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ESRI.ArcGIS.Tests.Legend.App"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Styles/Styles.xaml" /> <ResourceDictionary Source="Styles/NavigationStyle.xaml" /> <ResourceDictionary Source="/ResourceProject;Component/config.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>
Url="{StaticResource baseLayerUrl}"
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.