private void HandleScreenshot(object sender, ExecutedRoutedEventArgs e) { Visual visual = this.Target as Visual; ScreenshotDialog dialog = new ScreenshotDialog(); dialog.DataContext = visual; dialog.ShowDialog(); e.Handled = true; }
void HandleScreenshot(object sender, ExecutedRoutedEventArgs e) { var visual = Target as Visual; var dialog = new ScreenshotDialog(); dialog.DataContext = visual; dialog.ShowDialog(); e.Handled = true; }