Click here to Skip to main content
11,812,712 members (72,064 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WPF MVVM
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
Edited 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 at 25-Mar-13 10:46am
Thanks Yair-I, i didnt know about the EnableModelessKeyboardInterop(). Thanks for all the links too.
Maciej Los at 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
0 Abhinav S 270
1 CHill60 180
2 KrunalRohit 154
3 Palash Mondal_ 145
4 Sergey Alexandrovich Kryukov 140
0 OriginalGriff 3,877
1 KrunalRohit 2,496
2 CPallini 2,240
3 Maciej Los 2,205
4 ppolymorphe 1,750

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2015
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