<ESRI_ArcGIS_Client_Samples_MapPrinting:MapPrinterDialog x:Name="printPreviewMap" HorizontalAlignment="Right" Margin="0,192,-28,0" Grid.Row="2" Style="{StaticResource PrintPreviewStyle}" VerticalAlignment="Top">
<ESRI_ArcGIS_Client_Samples_MapPrinting:MapPrinter x:Name="printMap" Map="{Binding ElementName=MyMap, Mode=OneWay}" Style="{StaticResource MapPrinterStyle}" PrintExtent="{Binding Extent.Extent, ElementName=MyMap, Mode=TwoWay}" Title="{StaticResource Title}" d:LayoutOverrides="Width"/>
</ESRI_ArcGIS_Client_Samples_MapPrinting:MapPrinterDialog><StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Text="Tipo de folha:" Margin="5,0,5,0" VerticalAlignment="Center"></TextBlock>
<ComboBox x:Name="cbxPaperType" Width="110" Height="25" VerticalAlignment="Center">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
Command="{Binding PaperTypeCommand}"
CommandParameter="{Binding ElementName=cbxPaperType}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ComboBox.Items>
<ComboBoxItem IsSelected="True">A4</ComboBoxItem>
<ComboBoxItem>A3, A2, A1, A0</ComboBoxItem>
</ComboBox.Items>
</ComboBox>
</StackPanel>private void PaperType(object param)
{
if (param == null)
{
return;
}
ComboBox cbx = param as ComboBox;
ResourceDictionary dict = new ResourceDictionary();
Uri uri = new Uri("/MapPrintingControls;component/MapPrinter.xaml", UriKind.Relative);
dict.Source = uri;
if (cbx.SelectedIndex == 0)
{
ControlTemplate ct = (ControlTemplate)dict["MapPrinter_A4"];
Template = ct;
printMap.Width = 771;
printMap.Height = 1122;
Width = 793;
Height = 1122;
UpdateLayout();
}
}
<Viewbox> <ContentPresenter Content="{TemplateBinding MapPrinter}" MinHeight="200" /> </Viewbox>
Is there a way to restrict a service from appearing in the legend? I have an image service and a graphics layer that I don't want to show
private void Legend_Refreshed(object sender, ESRI.ArcGIS.Client.Toolkit.Legend.RefreshedEventArgs e)
{
Legend legend = sender as Legend;
if (legend != null && e.LayerItem.Layer is GraphicsLayer)
legend.LayerItems.Remove(e.LayerItem);
}
Sorry I have no clue.
Check that there is no mismatch in the dlls you referenced (MapPrintingControls and your app should reference the same ArcGIS client dlls).
If you just compile the sample solution (MapPrinting + MapPrintingControls), is it working?