Wrapping with Dependency Properties

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-04-27T14:40:47Z Indexed on 2010/04/27 14:43 UTC
Read the original article Hit count: 342

I've got a Windows Forms control that I'm wrapping with a WindowsFormsHost-derived class to access WPF's data binding functionality. The Forms control exposes properties that indicate its state, along with the standard property-changed event notifier.

For example, a Zoom property on the Forms control is accompanied with a ZoomChanged event. In the WindowsFormsHost wrapper, I'm using a DependencyProperty to represent the underlying Windows Forms control property. Binding works as expected going to the control; however, I'm not sure how to correctly propogate property changes from the wrapped control back out to binding subscribers (i.e., the Windows Form control changes its Zoom property and raises the ZoomChanged event). Any ideas on how to accomplish this? Should I be using a different approach?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about dependencyproperty