Пример #1
0
        public static void LoadFromViewModel(this DatePrinterLayer datePrinterLayer, DateElementViewModel dateElementViewModel)
        {
            DrawingFontStyles drawingFontStyles = DrawingFontStyles.Regular;

            if (dateElementViewModel.IsBold)
            {
                drawingFontStyles = drawingFontStyles | DrawingFontStyles.Bold;
            }
            if (dateElementViewModel.IsItalic)
            {
                drawingFontStyles = drawingFontStyles | DrawingFontStyles.Italic;
            }
            if (dateElementViewModel.IsStrikeout)
            {
                drawingFontStyles = drawingFontStyles | DrawingFontStyles.Strikeout;
            }
            if (dateElementViewModel.IsUnderline)
            {
                drawingFontStyles = drawingFontStyles | DrawingFontStyles.Underline;
            }

            GeoFont font = new GeoFont(dateElementViewModel.FontName.Source, dateElementViewModel.FontSize, drawingFontStyles);

            datePrinterLayer.DateString = dateElementViewModel.SelectedFormat;
            datePrinterLayer.DateFormat = dateElementViewModel.FormatPairs[dateElementViewModel.SelectedFormat];
            datePrinterLayer.Font       = font;
            datePrinterLayer.TextBrush  = dateElementViewModel.FontColor;
            datePrinterLayer.DragMode   = dateElementViewModel.DragMode;
            datePrinterLayer.ResizeMode = dateElementViewModel.ResizeMode;
        }
        public DateElementWindow()
        {
            InitializeComponent();

            contentPresenter.Content = new FontUserControl();
            viewModel   = new DateElementViewModel();
            DataContext = viewModel;

            HelpContainer.Content = HelpResourceHelper.GetHelpButton("PrintMapTextHelp", HelpButtonMode.NormalButton);
        }