By default the legend control displays the layer ID as name. So if you add layers to the map by code, the easiest way is to give a significant ID. Else, if you have no way to change the ID, you can hook up an handler to the Legend.Refreshed event and change the label in this handler.Something like:
private void MyLegend_Refreshed(object sender, Client.Toolkit.Legend.RefreshedEventArgs e)
{
var layerItem = e.LayerItem;
if (layerItem.Layer is ArcGISDynamicMapServiceLayer)
layerItem.Label = ((ArcGISDynamicMapServiceLayer)layerItem.Layer).MapName;
else if (layerItem.Layer is .......
}