private void Print() { var root = FindRoot(Visual); var dialog = new ScreenshotDialog { DataContext = root }; dialog.ShowDialog(); }
private void CaptureScreenShot(object sender, ExecutedRoutedEventArgs e) { //Window is always visual so no need to check it //System.Windows.Media.Visual visual = this as System.Windows.Media.Visual; ScreenshotDialog dialog = new ScreenshotDialog(); dialog.DataContext = this; dialog.ShowDialog(); e.Handled = true; }