2010-03-11 178 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

相關問題