代码之家  ›  专栏  ›  技术社区  ›  Razvi

必应Bing地图Silverlight控件自定义图钉

  •  0
  • Razvi  · 技术社区  · 15 年前

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

    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);
    
    1 回复  |  直到 8 年前
        1
  •  2
  •   Dave Clemmer manu    11 年前

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

    推荐文章