Printing WPF Visuals with MVVM Template

My ViewModel has a PrintCommand that executes the PrintCalendar () method. But the aka datagrid calendar is in the view, so how do I get my datagrid in the ViewModel?

How are my hands dirty and all this in a combination lock? Oh no...

PrintDialog printDlg = new PrintDialog();
printDlg.PrintVisual(datagrid, "Grid Printing.");
+3
source share

Source: https://habr.com/ru/post/1768299/


All Articles