Beispiel #1
0
        private void GenerateReceiptPages(PrintPageDescription printPageDescription, RichTextBlockOverflow previousOverflowContainer = null)
        {
            FrameworkElement page;

            if (previousOverflowContainer == null)
            {
                page = _firstPage;
            }
            else
            {
                page = new ReceiptContinuationPreviewPage(previousOverflowContainer);
            }

            PreparePrintPage(printPageDescription, page, page);

            var overflowContainer = (RichTextBlockOverflow)page.FindName("continuationPageLinkedContainer");

            if (overflowContainer.HasOverflowContent)
            {
                GenerateReceiptPages(printPageDescription, overflowContainer);
            }
        }
Beispiel #2
0
        private void CreateReceiptPages(PrintPageDescription printPageDescription, Reservation reservation, RichTextBlockOverflow previousOverflowElement)
        {
            FrameworkElement page;

            if (previousOverflowElement == null)
            {
                page = new ReceiptPreviewPage();
            }
            else
            {
                page = new ReceiptContinuationPreviewPage(previousOverflowElement);
            }

            PreparePrintPage(printPageDescription, reservation, page, page);

            // Find the last text container and see if the content is overflowing
            var overflowContainer = (RichTextBlockOverflow)page.FindName("continuationPageLinkedContainer");

            while (overflowContainer.HasOverflowContent)
            {
                CreateReceiptPages(printPageDescription, reservation, overflowContainer);
            }
        }