Hi Dominique! Thanks for providing the SL4 PDF print functionality sample. It looks to be most useful to a widespread audience. And I have enjoyed some success in accessing it through my web mapping application. I have successfully compiled the code you provided. Following your instructions in the README file I was able to include a reference to the 'MapPrintingControls.dll' from the build and add some assembly references to get it up and running in my application. The end-user was quite pleased. And, of course, asked for more.
I have read through the forum threads to find out how to customize the code to include a title and a legend on the map printout. I was able to add user-defined address and title fields to the map printout by customizing your code in the 'MapPrinterDialog.theme.xaml' file and including additional textbox entries on the dialog panel. And rebuilding the code in your sample.
I am also attempting to add a legend to the map printout by customizing the code in the 'MapPrinter.theme.xaml' file. However, I am not having much success. When I attempt to add the legend tags <esri:Legend></esri:Legend> the intellisense complains that the control is not recognized and to check my assembly references. I added the following to the top of the 'MapPrinter.theme.xaml' file. The 'ESRI.ArcGIS.Client.Toolkit' has been added to the references in your project. This may be a no-brainer but I have to admit I am stumped as to what the problem is. Am I doing this in the wrong place?
Now I may be misunderstanding how to implement the addition of a legend on the PDF map printout, so please inform me if I am not attempting to do this the right way. And do please let me know how to go about doing this correctly. I have no problem implementing a dynamic legend in my web mapping application.
The platform I am running is SL4 with ArcGIS API for Microsoft Silverlight/WPF v2.1 on the client-side, and ArcGIS 10 w/SP1 on the server side to read the legend dynamically in my application. The application I am calling your 'MapPrintingControls.dll' from is developed using VB.NET and not C#. Since this is a dll this should not effect anything. But it means I am unable to include the 'MapControls' folder within my VB project.
What am I doing wrong? Your help in regard to this matter is much appreciated.