I can't make MapTip's GraphicLayer binding to work:
in xaml:
<Canvas HorizontalAlignment="Left" VerticalAlignment="Top" >
<esri:MapTip x:Name="MyMapTip" BorderBrush="#99000000" Title="{Binding [OBJECTID]}"
GraphicsLayer="{Binding Path=mapTipLayer}"
BorderThickness="1" VerticalOffset="10" Opacity="0.7"
HorizontalOffset="10" Background="#DDFFFFFF" />
</Canvas>
in my ViewModel, I defined a mapTipLayer member:
public FeatureLayer mapTipLayer
{
get { return (FeatureLayer)GetValue(mapTipLayerProperty); }
set { SetValue(mapTipLayerProperty, value); }
}
public static readonly DependencyProperty mapTipLayerProperty =
DependencyProperty.Register("mapTipLayer", typeof(FeatureLayer), typeof(MainPage), new PropertyMetadata(null));
and I am adding layers dynamically and set mapTipLayer:
foreach (MapLayer mapLayer in mapLayers) // Loop through List with foreach
{
Debug.WriteLine(mapLayer.Url);
if (mapLayer.Type == "ArcGISTiledMapServiceLayer")
{
Layers.Add(new ArcGISTiledMapServiceLayer() { ID=mapLayer.ID, Url=mapLayer.Url, Visible=mapLayer.Visible, Opacity=mapLayer.Opacity });
}
else if (mapLayer.Type == "FeatureLayer")
{
FeatureLayer fLayer = new FeatureLayer() { ID = mapLayer.ID, Url = mapLayer.Url, Visible = mapLayer.Visible, Opacity = mapLayer.Opacity };
mapTipLayer = fLayer;
Layers.Add(fLayer);
}
}
Can someone help please? Thanks.