2010-03-11 180 views
0

我试图为Bing地图silverlight控件制作自定义图钉,但我只能添加1个图钉。在第二个图钉我得到以下错误:Bing地图Silverlight控件自定义图钉

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) 

有谁知道我可能会做错什么? 我将它添加到地图前设置以下属性:

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

回答

2

2图钉不能有相同的Name属性值。

+0

谢谢,它现在工作:)。 – Razvi 2010-03-11 21:29:55

相关问题