private void OnPrintVisualClick(object sender, RoutedEventArgs e) { var printDlg = new PrintDialog(); printDlg.PrintVisual(this, "Main Window"); }