public ProjectPathElementWindow(string projectPath) { InitializeComponent(); contentPresenter.Content = new FontUserControl(); viewModel = new ProjectPathElementViewModel(projectPath); DataContext = viewModel; HelpContainer.Content = HelpResourceHelper.GetHelpButton("PrintMapTextHelp", HelpButtonMode.NormalButton); }
public static void LoadFromViewModel(this ProjectPathPrinterLayer projectPathPrinterLayer, ProjectPathElementViewModel projectPathElementViewModel) { DrawingFontStyles drawingFontStyles = DrawingFontStyles.Regular; if (projectPathElementViewModel.IsBold) { drawingFontStyles = drawingFontStyles | DrawingFontStyles.Bold; } if (projectPathElementViewModel.IsItalic) { drawingFontStyles = drawingFontStyles | DrawingFontStyles.Italic; } if (projectPathElementViewModel.IsStrikeout) { drawingFontStyles = drawingFontStyles | DrawingFontStyles.Strikeout; } if (projectPathElementViewModel.IsUnderline) { drawingFontStyles = drawingFontStyles | DrawingFontStyles.Underline; } GeoFont font = new GeoFont(projectPathElementViewModel.FontName.Source, projectPathElementViewModel.FontSize, drawingFontStyles); projectPathPrinterLayer.ProjectPath = projectPathElementViewModel.ProjectPath; projectPathPrinterLayer.Font = font; projectPathPrinterLayer.TextBrush = projectPathElementViewModel.FontColor; projectPathPrinterLayer.DragMode = projectPathElementViewModel.DragMode; projectPathPrinterLayer.ResizeMode = projectPathElementViewModel.ResizeMode; }