Is it possible to access all the WPF Items from a winforms Project when selecting "add new Item" in VS 2010 ? I only have access to WPF userControl by default.
I would like to add a WPF Window to a winforms project. Not just a user control.
EDIT : Short answer : This does not seem to be possible per se, but it is possible to add WPF resources and the necessary references manually.
Apparently you cannot directly, but what you can do is add a new user control and then modify the code to make it a Window. Simply create a new WPF project, add a window and see what you need to change to turn your user control into a window.
In my opinion the "cleanest" option is using this scheme:
In MainProject add references to:
Thats all, now you can open your WPF windows from your MainProject (eg. by pressing a button):
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim mywpfform = New WPFProject.MainWindow //MainWindow is the default name of your first WPF window. Obviously you can open any other
mywpfform .Show()
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With