I have published a mapserver on my ArcGIS Server 9.3. I am developing a silverlight application using ArcGIS Silverlight API. Now I can load my map into my application and also the list of my layers that I can toggle their visibility. I just want to load my map legend in order to know the legend of each layer. The solution which I find in arcgis silverlight example is just as follow:
<esri:Legend Map="{Binding ElementName=Map}"
LayerIDs="BaseLayer"
LayerItemsMode="Tree"
/>
In visual studio 2010, I have an error for LayerIDs part which says that "Unable to cast from....". The definition of my map is also:
<esri:Map x:Name="Map" Background="White" MouseClick="QueryPoint_MouseClick" IsLogoVisible="False">
<esri:OpenStreetMapLayer ID="OpenStreetMap" Style="Mapnik">
</esri:OpenStreetMapLayer>
<esri:ArcGISDynamicMapServiceLayer ID="BaseLayer"
Url="http://sina-pc/ArcGIS/rest/services/Test/MapServer"
Initialized="ArcGISDynamicMapServiceLayer_Initialized" />
</esri:Map>
It also doesn't show any of my legends for BaseLayer map. Am I missing something or is there any problem with my map?