Click here to Skip to main content
13,048,584 members (79,376 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have 2 projects - 1 is a Winforms application and the second is a WPF form (both C# .NET4). I would like to call the WPF form from my winforms application by creating an object of the WPF application class(passing a few values to the constructor as well) and using the .show() method.

I need an example of how to do this as I am new to MVVM pattern and I am not sure how to do this.

name of view = MainWindow.xaml
name of view model viewModel = MyViewModel.cs (the data context of my view is set to my view model)
the model is common to both the winforms and WPF application.
I am not sure what object to create to display the WPF form.

If you can give me any link to a sample application it will be a big plus point.
Posted 25-Mar-13 2:16am
Updated 25-Mar-13 2:17am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I recently come across sample of creating systry application as systry application and not winform application that minimize to the try. long story short it include the using of winform and wpf in the same program.
this is the article:[^]
and the exact section:[^]

He wrote there that he took this from here:[^]

also from there you can go to mixing wpf and winform[^]

I hope this will help you.
rohith naik 25-Mar-13 10:46am
Thanks Yair-I, i didnt know about the EnableModelessKeyboardInterop(). Thanks for all the links too.
Maciej Los 25-Mar-13 11:06am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100