WPF used within a WinForms application, where to put Application resources?

前端 未结 2 831
终归单人心
终归单人心 2021-01-01 18:36

At present we host a number of WPF controls in a WinForms application. The application is started using the System.Windows.Forms.Application.Run(...)

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-01 19:00

    In a hosted environment you do not have easy access to the Application, Dr WPF has a couple of methods for working in a hosted scenario at http://drwpf.com/blog/2007/10/05/managing-application-resources-when-wpf-is-hosted/.

    I am personally using his SharedResources class in a work project, VB6 Form hosting Winforms UserControl hosting ElementHost hosting WPF UserControl with a Application wide theme, for the WPF controls.

提交回复
热议问题