Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
向WinForms主机公开WPF控件的属性_Wpf_Vb.net_Winforms_Elementhost - Fatal编程技术网

向WinForms主机公开WPF控件的属性

向WinForms主机公开WPF控件的属性,wpf,vb.net,winforms,elementhost,Wpf,Vb.net,Winforms,Elementhost,我看过好几篇类似的文章(如果有,请引导我去看),但我还没有找到任何明确的答案 我通过ElementHost在Windows窗体中托管了一个WPF控件。我的WPF控件(为了举例,我们称它为WpfControl)包含一个我想公开给表单的变量。这样做的一般标准做法是什么?事实上,它是WinForms UI中的WPF控件,不会改变任何事情,它仍然是一个.NET对象。因此,您可以从WPF控件公开一个公共属性,并从WinForms代码访问它

我看过好几篇类似的文章(如果有,请引导我去看),但我还没有找到任何明确的答案


我通过
ElementHost
在Windows窗体中托管了一个WPF控件。我的WPF控件(为了举例,我们称它为
WpfControl
)包含一个我想公开给表单的变量。这样做的一般标准做法是什么?

事实上,它是WinForms UI中的WPF控件,不会改变任何事情,它仍然是一个.NET对象。因此,您可以从WPF控件公开一个公共属性,并从WinForms代码访问它