Bing maps silverlight control custom pushpin

Posted by Razvi on Stack Overflow See other posts from Stack Overflow or by Razvi
Published on 2010-03-11T09:41:39Z Indexed on 2010/05/02 13:28 UTC
Read the original article Hit count: 3151

I tried to make a custom pushpin for the Bing Maps silverlight control, but I can only add 1 pushpin. At the second pushpin I get the following error:

System.ArgumentException: Value does not fall within the expected range.
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
   at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
   at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
   at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
   at System.Windows.PresentationFrameworkCollection`1.Add(T value)
   at MapInfo.Silverlight.CitiesControl.MainPage.c_GetCitiesCompleted(Object sender, GetCitiesCompletedEventArgs e)

Does anyone know what I might be doing wrong? I am setting the following properties before adding it to the map:

    public Location Location
    {
        get
        {
            return this.GetValue(MapLayer.PositionProperty) as Location;
        }
        set
        {
            this.SetValue(MapLayer.PositionProperty, value);
        }
    }
   this.SetValue(MapLayer.PositionOriginProperty, PositionOrigin.BottomLeft);

© Stack Overflow or respective owner

Related posts about bing-maps-controls

Related posts about silverlight-3.0