Beispiel #1
0
        private static void OnOverviewMapLayerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PrintMapPage me = d as PrintMapPage;

            if (me != null && me.OverviewMap != null)
            {
                me.OverviewMap.Layer = (e.NewValue as Layer).Clone();
            }
        }
Beispiel #2
0
        private static void OnLegendItemsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PrintMapPage me = d as PrintMapPage;

            if (me != null && me.LegendPanel != null)
            {
                me.CreateLegend();
            }
        }
Beispiel #3
0
        private static void OnPageTitleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PrintMapPage me = d as PrintMapPage;

            if (me != null && me.TitleBlock != null)
            {
                me.TitleBlock.Text = (string)e.NewValue;
            }
        }
Beispiel #4
0
        private static void OnViewerMapChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PrintMapPage me = d as PrintMapPage;

            if (me != null && me.PrintMap != null)
            {
                me.CloneMap();
            }
        }
Beispiel #5
0
        private static void OnPrintOverviewChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PrintMapPage me = d as PrintMapPage;

            if (me != null && me.OverviewMap != null)
            {
                me.OverviewMap.Visibility = ((bool)e.NewValue) ? Visibility.Visible : Visibility.Collapsed;
                me.CreateLegend(); // Re-arrange Legend Items
            }
        }
Beispiel #6
0
        private static void OnPrintLegendChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PrintMapPage me = d as PrintMapPage;

            if (me != null && me.LegendGrid != null)
            {
                me.LegendGrid.Visibility = ((bool)e.NewValue) ? Visibility.Visible : Visibility.Collapsed;
                me.UpdateMapSize(true);
            }
        }
Beispiel #7
0
        private static void OnRotateMapChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PrintMapPage me = d as PrintMapPage;

            if (me != null && me.PrintMap != null)
            {
                try // Work around the bug in API 2.2 - Crash if OverviewMap.Visibility = Collapsed
                {
                    me.PrintMap.Rotation = ((bool)e.NewValue) ? -90.0 : 0.0;
                }
                catch { }
            }
        }
Beispiel #8
0
        private static void OnMaintainScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PrintMapPage me = d as PrintMapPage;

            if (me != null && me.PrintMap != null && me.ViewerMap != null)
            {
                if (me.FitIntoPage)
                {
                    me.ScaleMapIntoPage();
                }
                else
                {
                    me.PrintMap.Extent = me.ViewerMap.Extent;
                }
            }
        }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/ESRI.SilverlightViewer;component/Widgets/PrintWidget.xaml", System.UriKind.Relative));
     this.PanelExportMap        = ((System.Windows.Controls.Grid)(this.FindName("PanelExportMap")));
     this.txtExportMapTitle     = ((System.Windows.Controls.TextBox)(this.FindName("txtExportMapTitle")));
     this.boxExportFormats      = ((System.Windows.Controls.ComboBox)(this.FindName("boxExportFormats")));
     this.boxLayoutTemplates    = ((System.Windows.Controls.ComboBox)(this.FindName("boxLayoutTemplates")));
     this.boxMetricUnits        = ((System.Windows.Controls.ComboBox)(this.FindName("boxMetricUnits")));
     this.txtMetricLabel        = ((System.Windows.Controls.TextBox)(this.FindName("txtMetricLabel")));
     this.boxNonmetricUnits     = ((System.Windows.Controls.ComboBox)(this.FindName("boxNonmetricUnits")));
     this.txtNonmetricLabel     = ((System.Windows.Controls.TextBox)(this.FindName("txtNonmetricLabel")));
     this.txtCopyright          = ((System.Windows.Controls.TextBox)(this.FindName("txtCopyright")));
     this.linkExportResult      = ((System.Windows.Controls.HyperlinkButton)(this.FindName("linkExportResult")));
     this.ExportMapButton       = ((System.Windows.Controls.Button)(this.FindName("ExportMapButton")));
     this.PanelPrintMap         = ((System.Windows.Controls.StackPanel)(this.FindName("PanelPrintMap")));
     this.txtPrintMapTitle      = ((System.Windows.Controls.TextBox)(this.FindName("txtPrintMapTitle")));
     this.printMapPage          = ((ESRI.SilverlightViewer.Generic.PrintMapPage)(this.FindName("printMapPage")));
     this.checkFitToPage        = ((System.Windows.Controls.CheckBox)(this.FindName("checkFitToPage")));
     this.checkKeepScale        = ((System.Windows.Controls.CheckBox)(this.FindName("checkKeepScale")));
     this.checkRotateMap        = ((System.Windows.Controls.CheckBox)(this.FindName("checkRotateMap")));
     this.checkPrintLegend      = ((System.Windows.Controls.CheckBox)(this.FindName("checkPrintLegend")));
     this.checkPrintOverview    = ((System.Windows.Controls.CheckBox)(this.FindName("checkPrintOverview")));
     this.UpdateMapButton       = ((System.Windows.Controls.Button)(this.FindName("UpdateMapButton")));
     this.PrintMapButton        = ((System.Windows.Controls.Button)(this.FindName("PrintMapButton")));
     this.PrintingProgressPanel = ((System.Windows.Controls.StackPanel)(this.FindName("PrintingProgressPanel")));
     this.PrintingPageText      = ((System.Windows.Controls.TextBlock)(this.FindName("PrintingPageText")));
     this.PrintingProgress      = ((System.Windows.Controls.ProgressBar)(this.FindName("PrintingProgress")));
     this.PanelPrintData        = ((System.Windows.Controls.StackPanel)(this.FindName("PanelPrintData")));
     this.StackWidgetCheck      = ((System.Windows.Controls.StackPanel)(this.FindName("StackWidgetCheck")));
     this.CreatePrintButton     = ((System.Windows.Controls.Button)(this.FindName("CreatePrintButton")));
 }