Breaking Change BC3444
Visible to All Users

WPF - A DocumentPreviewWindow has started using the DocumentPreviewControl class

This breaking change was introduced because the older Document Preview used XAML rendering to create documents, unlike the new Document Preview that uses GDI rendering.

The following classes have become obsolete:
- DocumentPreview;
- DocumentViewer;
RibbonDocumentPreviewWindow;
- LegacyLinkPreviewModel;
- LinkPreviewModel;
- PrintingSystemPreviewModel;
- ReportServicePreviewModel;
- XtraReportPreviewModel.

The DocumentPreviewWindow.Model  property is no longer available.

The following code illustrates how to create and initialize a Print Preview window:

C#
using DevExpress.Xpf.Printing; using System.Windows; // ... private void Button_Click(object sender, RoutedEventArgs e) { XtraReport1 report = new XtraReport1(); var window = new DocumentPreviewWindow(); window.PreviewControl.DocumentSource = report; report.CreateDocument(); window.Show(); }
Visual Basic
Imports DevExpress.Xpf.Printing Imports System.Windows ' ... Private Sub Button_Click(sender As Object, e As RoutedEventArgs) Dim report As New XtraReport1() Dim window = New DocumentPreviewWindow() window.PreviewControl.DocumentSource = report report.CreateDocument() window.Show() End Sub

To display a default Print Preview without creating a custom preview window, you can still use the methods of the PrintHelper class:

C#
PrintHelper.ShowPrintPreviewDialog(ownerWindow, report);

To use this functionality, add a reference to the DevExpress.Xpf.DocumentViewer.v16.1.Core assembly to your application.

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.