Using yFiles WPF in a Windows Forms Application |
| Applies to: yFiles WPF 2.2, 2.1, 2.0, 1.0 |
Type: Questions & Answers
Categories this article belongs to:
| yFiles WPF | > yFiles WPF Viewer | ||
| yFiles WPF | > yFiles WPF Viewer | > Displaying and Editing Graphs | > View Implementations |
This article describes how to make use of the yFiles WPF control in a Windows Forms application.
yFiles WPF provides a control for the Windows Presentation Foundation. WPF makes creating great, modern-looking UIs easier and greatly facilitates data binding custom controls to business data. yFiles WPF leverages these capabilities. The power of yFiles WPF can be utilized in Windows Forms applications using the ElementHost Windows Forms control to host WPF controls inside a Windows Forms application. MSDN hosts Walkthrough about hosting a WPF composite control in Windows Forms that shows how this can be achieved. yFiles WPF integrates well with Windows Forms applications when hosted directly or indirectly via a more complex hierarchy in an ElementHost control.
Minor possible drawbacks are not yFiles specific and include a less optimal integration between the various components and the application. E.g. in WPF there is an Application instance that is not automatically mapped to a corresponding entity in the Windows Forms application context. Application persistence and possibly internationalization needs to be done independently for both platforms and there might be visible visual inconsistencies in the display of the chrome of the controls (although yFiles itself by default only makes use of the scroll bars).
Minor possible drawbacks are not yFiles specific and include a less optimal integration between the various components and the application. E.g. in WPF there is an Application instance that is not automatically mapped to a corresponding entity in the Windows Forms application context. Application persistence and possibly internationalization needs to be done independently for both platforms and there might be visible visual inconsistencies in the display of the chrome of the controls (although yFiles itself by default only makes use of the scroll bars).
| Keywords: | Windows Forms - WPF - ElementHost - Compatibility |


