WPF, Crossbow, and the Composite UI Application Block (CAB)
So, you've invested a good deal of time in Windows Forms and even adopted the CAB Framework. However, sometimes you see the need for some rich content. An interesting approach to achieving this is using WPF; however, you don't want to re-write your application utilizing this new technology. Microsoft has come up with a good story for providing interop between Windows Forms and the Windows Presentation Foundation in a technology termed Crossbow. Now how does this play with CAB? Actually, quite nicely, I created a user-control that is also a smartpart and used Elementhost (a Windows Forms control that can be used to host a WPF element) to host a WPF user-control in it.
[SmartPart]
public partial class CustomerWPFGrid : UserControl
{
private ElementHost host;
private Example1 exGrid;
public CustomerWPFGrid()
{
InitializeComponent();
host = new ElementHost();
host.Dock = DockStyle.Fill;
pnlMain.Controls.Add(host);
exGrid = new Example1();
host.Child = exGrid;
}
}
At Infragistics, we have a lot of technology groups that are working on a host of different technologies. One of those groups is our WPF Team and they've been working on a control called DataPresenter. This control has two views, one that is a Carousel and one that is a hierarchical datagrid. Since, I want to really show off what could be accomplished with WPF and CAB, I borrowed their work to host inside of the standard CAB application, Bank Teller. Here's a screenshot for the end result!