void OnPrintPreview(object sender, ExecutedRoutedEventArgs e)
        {
            PrintDialog  printDialog = PrintPreviewViewContent.PrintDialog;
            FlowDocument fd          = DocumentPrinter.CreateFlowDocumentForEditor(this);

            PrintPreviewViewContent.ApplySettingsToFlowDocument(printDialog, fd);
            PrintPreviewViewContent.ShowDocument(fd, Path.GetFileName(this.FileName));
        }
        void OnPrint(object sender, ExecutedRoutedEventArgs e)
        {
            PrintDialog printDialog = PrintPreviewViewContent.PrintDialog;

            if (printDialog.ShowDialog() == true)
            {
                FlowDocument fd = DocumentPrinter.CreateFlowDocumentForEditor(this);
                PrintPreviewViewContent.ApplySettingsToFlowDocument(printDialog, fd);
                IDocumentPaginatorSource doc = fd;
                printDialog.PrintDocument(doc.DocumentPaginator, Path.GetFileName(this.FileName));
            }
        }