5

I really like some of the pre-built controls available in the Silverlight 4 Toolkit

I understand the CLRs are different but I was hoping that I could download the source and recompile for the CLR that WPF uses.

Is this possible? The WPF Toolkit is very basic by comparison and doesn't have encouraging reviews.

Many Thanks.

3 Answers 3

3

Have you looked at the Extended WPF Toolkit: http://wpftoolkit.codeplex.com/

0

Well, both WPF and Silverlight uses the same CLR version (runtime v2 or v4). The difference is in these two frameworks (libraries) theirselves.

Theoretically, it's possible, but depends on concrete code.

This might help:

  1. Differences
  2. Code reuse in WPF and Silverlight
0

It is certainly possible, but you won't be able to recompile for WPF. You'd need to create brand new project files (csproj) for WPF or convert the existing ones manually.

In addition, you'd have to target WPF 4, since the Silverlight toolkit makes heavy use of the VisualStateManager. Or you could get the VisualStateManager from the WPF toolkit, and target WPF 3.5 SP1.

There are going to be several supporting classes and/or class members in the Silverlight toolkit, which are not needed in WPF. Such as controls that mimic the IsMouseOver property using MouseEnter/MouseLeave events. These would need to be removed and updated to leverage the WPF version.

After doing all that, it should compile for WPF. You may run into some issues during runtime though, due to quirks with differences in the frameworks. Each of these would have to addressed individually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.