Silverlight printing sample

6906
52
05-25-2011 11:22 AM
DanDong
New Contributor
Hi everyone,

I am using the silverlight printing sample from code gallery (http://www.arcgis.com/home/item.html?id=e361c2cc69784fcba34358d0458f66e3).

According to the ReadMe, I should add a reference to the MapPrintingControls.dll (located at
MapPrintingControls/Bin/Release) to my silverlight application.

But I cannot find MapPrintingControls.dll in that path and neither the whole download folder, thus I cannot add this reference. Does anyone has clue for this? or if you have the dll, could you please share it with me 🙂 Really appreciate.
0 Kudos
52 Replies
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
I haven't looked at the download, but I imaging if you build the solution (in release mode) it'll create the DLL for you.
0 Kudos
tomw
by
New Contributor
You should be able to find from MapPrintingControls/obj/Release. You may like to add MapPrintingControls project to your solution, this way you will be able to modify it.

Hope this help.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Andrew is right. The dll's are not provided in the zip. You must build the solution to create them.
0 Kudos
DanDong
New Contributor
Hey guys, thank you! I build the application and find the dll file in the release folder. 🙂
0 Kudos
DanDong
New Contributor
Sorry I have to ask another question. How can I change the template of the print dialog? Like in this screen shot [ATTACH]6851[/ATTACH]. In the bottom part, I think I don't need such options:
Rotate Map:
Page 1/3
Print to Scale

I kinda want to delete the textblock, checkbox and slidebar....
Is there some place that I can change them? If they are from a style, could you please share the style template? I don't have the blend...Thank you 🙂
0 Kudos
DominiqueBroux
Esri Frequent Contributor

Is there some place that I can change them? If they are from a style, could you please share the style template? I don't have the blend...Thank you


You have to retemplate the MapPrinterDialog. The default style is provided with the sources in MapPrinterDialog.Theme.xaml
0 Kudos
DanDong
New Contributor
You have to retemplate the MapPrinterDialog. The default style is provided with the sources in MapPrinterDialog.Theme.xaml


Hey Dominique, thank you 🙂 I found the template in MapPrinterDialog.Theme.xaml. Should I add this file via Add-Add existing item in my application? I tried this and I changed this line
mlns:local="clr-namespace:ESRI.ArcGIS.Client.Samples.MapPrinting"
to xmlns:controls="clr-namespace:ESRI.ArcGIS.Client.Samples.MapPrinting;assembly=MapPrintingControls" since the first one has an error.
I also changed "local" in <local:LogConverter x:Key="logConverter" /> to "controls" and the other "local" in the xaml.

But I still cannot see the layout of the printerdialog, it says: Internationally left blank, the document root element is not supported by the visual designer.

Did I miss something? or should I change the template in other ways instead of add the existing item? Thank you!
0 Kudos
DominiqueBroux
Esri Frequent Contributor

Should I add this file via Add-Add existing item in my application?


There are a few ways to achieve that. The simplest is this one:
1) Copy the LogConverter and MapPrinterDialog style to the resources of your main page.
2) Change the local namespace to controls
3) Give a key to the MapPrinterDialog style
4) Change the style as you want
5) Use this style for your MapPrinterDialog

Something like:
 
  <UserControl.Resources>
    <controls:LogConverter x;Key="logConverter" />
    <Style x:Key="myMapPrinterDialogStyle" TargetType="controls:MapPrinterDialog">
..........
 
    <controls:MapPrinterDialog Style="{StaticResource myMapPrinterDialogStyle}" ...
...
0 Kudos
DanDong
New Contributor
Hey Dominique, thank you, that works very well 🙂 I successfully did it!

I want to use the printer style with legend which I have found in the sample codes. I have two questions here. I attach a screenshot here [ATTACH]6931[/ATTACH]
1. In the map frame, the map has been zoomed in, but in the print page the map doesn't zoom in (stays the Illinois state) leaving only a red rectangle in the northwest part (sorry,,,,it's very small...) as the area that will be printed. I see from your sample, when hitting the toggle button, the print dialog show again with a refreshed scale. In my application, I actually use a button (not a toggle button) to show the print dialog. Is there a way to get a zoomed map in the print dialog?

2. There is a difference between the two legends in the screenshot. I use the 'layerids' to limit the layers displayed in the legend. But I didn't find the similar thing in the legend in the printer style. So in the printer dialog, the legend side display all of the layers in my application. Is there a place in the printer style I can limit the 'layerids'?

Thank you! 😄
0 Kudos