//File:Window.xaml.cs using System; using System.Printing; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Xps; namespace WpfApplication1 { public partial class Window1 : Window { public Window1() { InitializeComponent(); } private void btnPrintVisual_Click(object sender, RoutedEventArgs e) { Visual visual = new Grid();