views:

75

answers:

1

We're considering migrating a WinForms app to WPF, but are just starting on the WPF learning curve now that 4.0 is out.

What I'd like to do is migrate our application commands (cut, copy, paste, etc) to a WPF-like command-binding system, while still running as a WinForms app - but in such a way as to make the migration easy when we go ahead with WPF.

The ideal approach would be to implement our commands using the WPF command interfaces, classes and events directly, and simply hooking the WinForms events up to them with our own dispatcher.

Has anyone tried something like this or know if it might be possible?

A: 

It appears, as nobody has any answers, that the safest approach for this will be to use a WPF-like structure and naming for the classes so that all our business logic is encapsulated into Commands, then use our own dispatch mechanism for the time being in the WinForms app. This would make the Commands trivial to port (just changing them to derive off the WPF classes/interfaces) - then we'd just need to bind new WPF UI to the existing commands and strip out our WinForms dispatch code.

Jason Williams