コード例 #1
0
        public ProjectPathElementWindow(string projectPath)
        {
            InitializeComponent();

            contentPresenter.Content = new FontUserControl();
            viewModel   = new ProjectPathElementViewModel(projectPath);
            DataContext = viewModel;

            HelpContainer.Content = HelpResourceHelper.GetHelpButton("PrintMapTextHelp", HelpButtonMode.NormalButton);
        }
コード例 #2
0
        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;
        }