Пример #1
0
        private void btnPrintPreview_Click(object sender, RoutedEventArgs e)
        {
            PrintPreviewWindow previewWnd = new PrintPreviewWindow("OrderDocument.xaml", GlobalData.m_orderExample, new OrderDocumentRenderer());

            previewWnd.Owner         = this;
            previewWnd.ShowInTaskbar = false;
            previewWnd.ShowDialog();
        }
Пример #2
0
        private void btnPrintDirect_Click(object sender, RoutedEventArgs e)
        {
            btnPrintDirect.IsEnabled = false;
            PrintDialog  pdlg = new PrintDialog();
            FlowDocument doc  = PrintPreviewWindow.LoadDocumentAndRender("OrderDocument.xaml", GlobalData.m_orderExample, new OrderDocumentRenderer());

            Dispatcher.BeginInvoke(new DoPrintMethod(DoPrint), DispatcherPriority.ApplicationIdle, pdlg, ((IDocumentPaginatorSource)doc).DocumentPaginator);
            m_timerToEnableButton = new Timer(TestTimerCallback, null, 3000, Timeout.Infinite);
        }
Пример #3
0
        private void btnPrintDlg_Click(object sender, RoutedEventArgs e)
        {
            PrintDialog pdlg = new PrintDialog();

            if (pdlg.ShowDialog() == true)
            {
                FlowDocument doc = PrintPreviewWindow.LoadDocumentAndRender("OrderDocument.xaml", GlobalData.m_orderExample, new OrderDocumentRenderer());
                Dispatcher.BeginInvoke(new DoPrintMethod(DoPrint), DispatcherPriority.ApplicationIdle, pdlg, ((IDocumentPaginatorSource)doc).DocumentPaginator);
            }
        }