WPF Bind to the list of installed printers
bind, list, printing, wpf, xaml
Solution
Add the namespace for System.Drawing.Print to your XAML code:
xmlns:Printing="clr-namespace:System.Drawing.Printing;assembly=System.Drawing"
Then add the combobox to show the list of printers installed on the system:
<ComboBox Name="cmbPrinterSelection" Width="300" ItemsSource="{x:Static Printing:PrinterSettings.InstalledPrinters}" SelectionChanged="cmbPrinterSelection_SelectionChanged" />
Hopefully this will save someone some time.
Problem
How to bind to the list of System.Drawing.Printing.PrinterSettings.InstalledPrinters, which is a static StringCollection, in WPF XAML. For example, to use it in a ComboBox, so a user can select the printer to use.