开发者

windows application user control in wpf

开发者 https://www.devze.com 2022-12-28 07:10 出处:网络
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 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 inte开发者_运维知识库llisense 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号