Expose properties of a WPF control to the WinForms host

551 Views Asked by At

Ia have seen several similar posts (so if there is one, please guide me to it), but I haven't found any clear answers.

I've got a WPF control hosted inside a Windows Forms form via ElementHost. My WPF control (let's just call it WpfControl for the sake of an example) contains a variable that I'd like to expose to my Form. What is the general standard practice to do that?

1

There are 1 best solutions below

0
On BEST ANSWER

The fact it's a WPF control inside a WinForms UI doesn't change anything, it's still a .NET object. So you can just expose a public property from the WPF control and access it from your WinForms code...