سؤال

I have a wpf element host sitting in winfrom.

I would like to bind the property of the element to the property of the winfrom.

In search I found the opposite solution, binding between winfrom to wpf (when the win is sitting in wpf).

Here 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 so ..

I also want to keep the the principle of MVVM in wpf element host.

There is a way to do this?

هل كانت مفيدة؟

المحلول

Finally I solved it this way:

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

I binding the property to element in xaml

and that's all.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top