samar
samar

Reputation: 5201

windows application user control in wpf

I have created a user control in windows application and used it in wpf. The user control is in a seperate project and solution than that of wpf. I have exposed some properties in the user control and tried to use it in a wpf form. I have used it in the WindowsFormsHost element and also added WindowsFormsIntegration reference. I am facing the following problems:

  1. I am able to see the user control in the toolbox but it is disabled.
  2. I am able to design the user control in xaml and give values to properties. I am also getting the properties in intellisense but the same is not getting reflected/applied during design as well as run time.
  3. I am not able to see the control in the properties window even after selecting it. I am just able to see WindowsFormsHost in the property window.

I am not able to find any sample project or explanation of this in code project. If there is any then please do let me know. Also I am able to use this user control in a windows application very easily and it is working fine. Am i missing anything for wpf? I can give the source code if required but i dont think it will be of much help as i have not done anything fancy.

Upvotes: 0

Views: 788

Answers (1)

jasonk
jasonk

Reputation: 1570

Is the control project compiled or just added in the solution?
Is the control project compiled as Debug or Release? What language is the control compiled in?

"Walkthrough: Hosting a Windows Forms Control in WPF"

Possible help:

http://social.msdn.microsoft.com/forums/en-US/wpf/thread/2fd0d9dd-eaa9-494d-8ec4-d896c33732d6

Upvotes: 3

Related Questions