예제 #1
0
        public ScaleLineElementWindow(MapPrinterLayer mapPrinterLayer)
        {
            InitializeComponent();
            viewModel   = new ScaleLineElementViewModel(mapPrinterLayer);
            DataContext = viewModel;

            HelpContainer.Content = HelpResourceHelper.GetHelpButton("PrintMapScaleLineHelp", HelpButtonMode.NormalButton);
        }
예제 #2
0
        internal static ScaleLinePrinterLayer GetScaleLinePrinterLayer(ScaleLineElementViewModel scaleLineViewModel)
        {
            ScaleLinePrinterLayer scaleLinePrinterLayer = new ScaleLinePrinterLayer(scaleLineViewModel.MapPrinterLayer)
            {
                DrawingExceptionMode = DrawingExceptionMode.DrawException
            };

            scaleLinePrinterLayer.LoadFromViewModel(scaleLineViewModel);

            RectangleShape pageBoundingbox = scaleLineViewModel.MapPrinterLayer.GetPosition(PrintingUnit.Inch);
            var            pageCenter      = pageBoundingbox.LowerLeftPoint;

            scaleLinePrinterLayer.SetPosition(1.25, .25, pageCenter.X + 0.75, pageCenter.Y + .5, PrintingUnit.Inch);
            return(scaleLinePrinterLayer);
        }
예제 #3
0
 public static void LoadFromViewModel(this ScaleLinePrinterLayer scaleLinePrinterLayer, ScaleLineElementViewModel scaleLineElementEntity)
 {
     scaleLinePrinterLayer.MapUnit        = scaleLineElementEntity.MapPrinterLayer.MapUnit;
     scaleLinePrinterLayer.DragMode       = scaleLineElementEntity.DragMode;
     scaleLinePrinterLayer.BackgroundMask = scaleLineElementEntity.BackgroundStyle;
     scaleLinePrinterLayer.UnitSystem     = scaleLineElementEntity.SelectedUnitSystem;
 }