0

I have a WPF element host sitting in a WinForm.

I would like to bind a property of the element to a property of the WinForm.

In my searches I found the opposite solution, binding between WinForms to WPF properties (when the WinForm is sitting on a WPF host).

Here is an example: How to bind a windows control in WPF????

I also saw this answer (not exactly an answer, I'd say a conclusion): Binding to a WPF hosted control's DependencyProperty in WinForms

It did not help me. I also want to keep the the principle of MVVM in the WPF element host.

|It there a way to do this?

ouflak
  • 2,458
  • 10
  • 44
  • 49
Hodaya Shalom
  • 4,327
  • 12
  • 57
  • 111

1 Answers1

0

Finally I solved it this way:

I created a property in ViewModel and init him through the WinForm when I use the wpf host control in the first time.

I binding the property to element in xaml

and that's all.

Vizel Leonid
  • 456
  • 7
  • 15
Hodaya Shalom
  • 4,327
  • 12
  • 57
  • 111
  • I have the same problem at the moment. Can you please more collaborate, share some codes? Thanks – Lati Dec 06 '17 at 10:25