I'm using the beta 2.1 API and taking an RSS feed that has lat/long coordinates and adding it to a GraphicsLayer that I've programmatically created - I've added some of the attributes to each of the graphics as such and added them to a graphicslayer called pGraphicsLayer:
graphic.Attributes.Add("Title", item.Title.Text)
graphic.Attributes.Add("Summary", item.Summary.Text)
graphic.Attributes.Add("PublishDate", item.PublishDate)
If item.Links.Count > 0 Then
graphic.Attributes.Add("Link", item.Links(0).Uri)
End If
graphic.Attributes.Add("FeedItem", item)
graphic.Attributes.Add("Id", item.Id)
I've put a UserControl on my XAML page as such:
<UserControl x:Name="hmTooltip" HorizontalAlignment="Left" Margin="132,141,0,289" Width="140">
<TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=FeedItem, Mode=OneWay}"
HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap" Grid.Row="1" Grid.Column="1" Height="30" Width="190" FontSize="10" Foreground="Black" Margin="2,0,0,0" />
</UserControl>
But for the life of me I can't figure out how to get the MapTips to work on the pGraphicsLayer object that I programmatically created (the points show up, etc but nothing on hover - it essentially crashes). I've tried setting the pGraphicsLayer.MapTip = hmTooltip (my user control)Am I going about this the correct way? when I hover over i get the following message:"Message: Unhandled Error in Silverlight 2 Application Value does not fall within the expected range."
Meanwhile I'm using a Silverlight 4 environment so not sure why that's giving me a Silverlight 2 error?