public ScaleLineElementWindow(MapPrinterLayer mapPrinterLayer) { InitializeComponent(); viewModel = new ScaleLineElementViewModel(mapPrinterLayer); DataContext = viewModel; HelpContainer.Content = HelpResourceHelper.GetHelpButton("PrintMapScaleLineHelp", HelpButtonMode.NormalButton); }
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); }
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; }