public ImageElementViewModel() { images = new ObservableCollection <byte[]>(); for (int i = 1; i <= 15; i++) { var path = string.Format(CultureInfo.InvariantCulture, previewImagePath, i); if (previewImagePath.StartsWith("pack:")) { images.Add(StreamToBytes(Application.GetResourceStream(new Uri(path)).Stream)); } else { images.Add(File.ReadAllBytes(path)); } } SelectedImage = images[0]; resizeMode = PrinterResizeMode.MaintainAspectRatio; dragMode = PrinterDragMode.Draggable; backgroundStyle = new AreaStyle(); backgroundStyle.DrawingLevel = DrawingLevel.LabelLevel; AreaStyle areaStyle = new AreaStyle(new GeoPen(GeoColor.StandardColors.Black, 1)); areaStyle.Name = "Area Style"; areaStyle.DrawingLevel = DrawingLevel.LabelLevel; backgroundStyle.CustomAreaStyles.Add(areaStyle); }
public ScaleLineElementViewModel(MapPrinterLayer mapPrinterLayer) { PropertyChanged += ScaleLineElementEntity_PropertyChanged; this.mapPrinterLayer = mapPrinterLayer; dragMode = PrinterDragMode.Draggable; selectedUnitSystem = ScaleLineUnitSystem.ImperialAndMetric; BackgroundStyle = new AreaStyle(); BackgroundStyle.CustomAreaStyles.Add(new AreaStyle(new GeoSolidBrush(GeoColor.StandardColors.Transparent))); }
public TextElementViewModel(bool withPreview = true) { text = string.Empty; fontName = new System.Windows.Media.FontFamily("Arial"); fontSize = 24; fontColor = new GeoSolidBrush(GeoColor.StandardColors.Black); dragMode = PrinterDragMode.Draggable; resizeMode = PrinterResizeMode.Resizable; this.withPreview = withPreview; PropertyChanged += TextElementEntity_PropertyChanged; }
public ProjectPathElementViewModel(string projectPath) { fontName = new System.Windows.Media.FontFamily("Arial"); fontSize = 12; fontColor = new GeoSolidBrush(GeoColor.StandardColors.Black); dragMode = PrinterDragMode.Draggable; resizeMode = PrinterResizeMode.Resizable; this.projectPath = projectPath; PropertyChanged += ProjectPathElementEntity_PropertyChanged; RefreshPreview(""); }
public DataGridViewModel() { addingColumnName = string.Empty; fontName = new System.Windows.Media.FontFamily("Arial"); fontColor = new GeoSolidBrush(GeoColor.StandardColors.Black); resizeMode = PrinterResizeMode.Resizable; dragMode = PrinterDragMode.Draggable; currentDataTable = new DataTable(); currentDataTable.Columns.CollectionChanged += Columns_CollectionChanged; PropertyChanged += DataGridViewModelPropertyChanged; FontSize = 9; }
public DateElementViewModel() { formatPairs = new Dictionary <string, string>(); fontName = new System.Windows.Media.FontFamily("Arial"); fontSize = 12; fontColor = new GeoSolidBrush(GeoColor.StandardColors.Black); dragMode = PrinterDragMode.Draggable; resizeMode = PrinterResizeMode.Resizable; formats = GetDefaultDateFormats(); selectedFormat = formats.FirstOrDefault(); PropertyChanged += DateElementEntity_PropertyChanged; RefreshPreview(""); }
public ScaleBarElementViewModel(MapPrinterLayer mapPrinterLayer) { this.mapPrinterLayer = mapPrinterLayer; background = new AreaStyle(); background.CustomAreaStyles.Add(new AreaStyle(new GeoSolidBrush(GeoColor.StandardColors.Transparent))); selectedUnitSystem = UnitSystem.Metric; color = new GeoSolidBrush(GeoColor.StandardColors.Black); alternatingColor = new GeoSolidBrush(GeoColor.StandardColors.White); resizeMode = PrinterResizeMode.Resizable; dragMode = PrinterDragMode.Draggable; PropertyChanged += ScaleBarViewModelPropertyChanged; SelectedNumericFormatType = ScaleNumericFormatType.None; }