public Task <bool> ShowDialogAsync(PrintDocument document) { var dialog = new PrintDialog(); var viewModel = new PrintDialogViewModel(document, r => dialog.Close(r)); dialog.DataContext = viewModel; return(dialog.ShowDialog <bool>(_owner)); }