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?
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); }
<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(); } }
<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>
<Grid.Resources> <esri:MarkerSymbol x:Name="CustomSymbol1"> <esri:MarkerSymbol.ControlTemplate> <ControlTemplate> <Border Child="{Binding Attributes[MyTextBlock]}"/> </ControlTemplate> </esri:MarkerSymbol.ControlTemplate> </esri:MarkerSymbol> </Grid.Resources>
<ToggleButton x:Name="btnToggleMapPrinterDialogPanel" IsChecked="True" ToolTipService.ToolTip="Print Dialog"> <ToggleButton.Content> <Image Source="/MapPrintingControls;component/Images/i_print.png" Stretch="Fill" /> </ToggleButton.Content> </ToggleButton>
<!--MapPrinter Dialog Panel--> <userControls:CollapsiblePanel x:Name="MapPrinterDialogPanel" Width="340" Height="405" IsExpanded="{Binding ElementName=btnToggleMapPrinterDialogPanel, Path=IsChecked, Mode=TwoWay}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,60,10,0" Effect="{StaticResource dropShadow}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal" Background="{StaticResource CommonPanelBorderBackgroundBrush}" Effect="{StaticResource miniDropShadow}" > <TextBlock Foreground="White" FontSize="12" Text="Page Style : " TextWrapping="NoWrap" VerticalAlignment="Center" /> <ComboBox Name="comboPrintStyle" SelectionChanged="comboPrintStyle_SelectionChanged" Margin="5,2" MinWidth="80" SelectedIndex="0" VerticalAlignment="Center"> <ComboBox.Items> <sys:String>(Default)</sys:String> <sys:String>Basic</sys:String> <sys:String>WithOverview</sys:String> <sys:String>WithClonedMapAsOverview</sys:String> <sys:String>WithLegend</sys:String> </ComboBox.Items> </ComboBox> </StackPanel> <printing:MapPrinterDialog x:Name="MapPrinterDialog" Background="{StaticResource CommonPanelBorderBackgroundBrush}" BorderBrush="{StaticResource CommonBorderBrush}" Grid.Row="1"> <printing:MapPrinter x:Name="mapPrinterWithDialog" Map="{Binding ElementName=Map}" Title="Map Title" IsScaleFixed="True" Scale="2000000" IsActive="{Binding ElementName=btnToggleMapPrinterDialogPanel, Path=IsChecked }"/>/> </printing:MapPrinterDialog> </Grid> </userControls:CollapsiblePanel> <!--END MapPrinter Dialog Panel--> So since I'm trying to use a collapisble panel instead of userControls:WindowPanel that you created I'm having to change IsOpen to something and I was trying IsExpanded. The code complies and everything seems good but the toggle button is not closing and opening the print dialog. IsOpen="{Binding ElementName=btnToggleMapPrinterDialogPanel, Path=IsChecked, Mode=TwoWay}"
IsExpanded="{Binding ElementName=btnToggleMapPrinterDialogPanel, Path=IsChecked, Mode=TwoWay}"
it did not apply to a button...just a togglebutton I think.
The only problem I'm having is my printing dialog isn't refreshing when my map extent changes
<!--MapPrinter Dialog Panel--> <userControls:CollapsiblePanel x:Name="MapPrinterDialogPanel" Width="340" Height="405" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,60,10,0" Effect="{StaticResource dropShadow}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal" Background="{StaticResource CommonPanelBorderBackgroundBrush}" Effect="{StaticResource miniDropShadow}" > <TextBlock Foreground="White" FontSize="12" Text="Page Style : " TextWrapping="NoWrap" VerticalAlignment="Center" /> <ComboBox Name="comboPrintStyle" SelectionChanged="comboPrintStyle_SelectionChanged" Margin="5,2" MinWidth="80" SelectedIndex="0" VerticalAlignment="Center"> <ComboBox.Items> <sys:String>(Default)</sys:String> <sys:String>Basic</sys:String> <sys:String>WithOverview</sys:String> <sys:String>WithClonedMapAsOverview</sys:String> <sys:String>WithLegend</sys:String> </ComboBox.Items> </ComboBox> </StackPanel> <printing:MapPrinterDialog x:Name="MapPrinterDialog" Background="{StaticResource CommonPanelBorderBackgroundBrush}" BorderBrush="{StaticResource CommonBorderBrush}" Grid.Row="1"> <printing:MapPrinter x:Name="mapPrinterWithDialog" Map="{Binding ElementName=Map}" Title="Map Title" IsScaleFixed="True" Scale="2000000" /> </printing:MapPrinterDialog> </Grid> </userControls:CollapsiblePanel>
<userControls:WindowPanel x:Name="MapPrinterDialogPanel" Width="340" Height="405" IsOpen="{Binding ElementName=btnToggleMapPrinterDialogPanel, Path=IsChecked, Mode=TwoWay}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,60,10,0">
System.Windows.Application.LoadComponent(this, new System.Uri("/TabbedRibbon;component/MainPage.xaml", System.UriKind.Relative));
<userControls:CollapsiblePanel x:Name="PrintWindow" IsExpanded="True" > <printing:MapPrinterDialog Height="410" Width="340"> <printing:MapPrinter x:Name="mapPrinter" Map="{Binding ElementName=Map}"/> </printing:MapPrinterDialog> </userControls:CollapsiblePanel>
<controls:MapPrinterDialog Height="410" Width="340"> <controls:MapPrinter x:Name="mapPrinter" Map="{Binding ElementName=Map}"/> </controls:MapPrinterDialog>
When I set the solution startup as MapPrinting.web, I get a directory listing when I build and run the solution.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.