How to bind MapTip DataContext

Discussion created by gregslutz on Feb 27, 2013
Latest reply on Mar 4, 2013 by dbroux-esristaff
I have a collection of Users which are bound to a GraphicsLayer using a PointDataSource. The graphics appear OK, but the MapTips do not bind to the User properties.

My User class looks like this:
public class User
    public User()

    public User(double lon, double lat)
        this.Latitude = lat;
        this.Longitude = lon;

    public string FirstName { get; set; }
    public string LastName { get; set; }
    public double Longitude { get; set; }
    public double Latitude { get; set; }

My ViewModel also exposes a Users ObservableCollection which is bound to my PointDataSource.

<!-- data source -->
        ItemsSource="{Binding Source={StaticResource usersViewModel}, Path=Users}"  
        XCoordinateBinding="{Binding Longitude}"
          YCoordinateBinding="{Binding Latitude}" >

How can I bind my MapTip to display the FirstName and LastName properties from my user? Currently I have this below, however the DataContext on the Border is always null. I don't know how to bind this to the point which contains the User instance for each specific map tip.

<!-- tooltip -->
    <Border Padding="4,2" Background="Black" DataContext="{Binding [DataContext]}">
            <TextBlock Foreground="White" Loaded="TextBlock_Loaded">
                <Run Text="User: " />
                <Run Text="{Binding FirstName}" />
                <Run Text="{Binding LastName}" />

Graphics display correctly for each User (Lat/Long is good) but the MapTips appear empty.