2010-03-11 3 views
0

J'ai essayé de faire une punaise personnalisée pour le contrôle Silverlight Bing Maps, mais je ne peux ajouter qu'une seule punaise. À la deuxième punaise, j'obtiens l'erreur suivante:Bing maps silverlight contrôle personnalisé pushpin

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) 

Est-ce que quelqu'un sait ce que je peux faire mal? Je suis en train de les propriétés suivantes avant de l'ajouter à la carte:

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

Répondre

2

2 ne peuvent pas avoir pushpins la même Name valeur de la propriété.

+0

Merci, ça marche maintenant :). – Razvi

Questions connexes