Is is possible to host Silverlight widgets from a WPF app? - wpf

If I wanted to create some Silverlight widgets and host them within WPF is this possible?
I've searched for examples & found a few concepts online but no approaches that actually panned out / work / and a bunch of dead links.
Has anyone successfully done this or any ideas for how to do this? Any help is appreciated.

You can try my SilverlightViewport project. It allows for rendering Silverlight programs in WPF. Should support all versions of SL.

The brute approach would be using the WebBrowserControl. Other than that, I don't know. Maybe you could unzip the .XAP file and try to load the XAMLs and Assemblies you would find. ;-)

What features specific to Silverlight do you use in those widgets? Is there a real problem with making them work in both Silverlight and WPF and compiling 2 versions?

Related

Transitioning from WPF Windows 7 to UWP

Im developing a Desktop app with WFP, but I've to migrate it to UWP Windows 10. Does anybody knows what this conversion involves? How complex is it?
Thank you in advance for the help :)
XAML for WPF and WINRT is not same because lot of classes which exist for WPF are missing in WINRT library. So the porting may have lots of work to do.
This may be helpful to you: https://channel9.msdn.com/Events/Build/2015/3-741
If you are going to convert it from WPF to UWP be sure to keep an eye out for the next few things:
ASync calls
a framework with less options but same possibilities
depends on your code and programme, but if you are experienced it might only take a few hours :)
.NET in WinRT is a lot more limited than the one in WPF.
So the level of difficulty of porting directly depends to your app's functionality.

Where is the code for SL4 plugin for Sonar?

I just found out that, Sonar does not support Silverlight 5, but it does support Silverlight 4. I thought, if I can take a look at Sl4 plugin code and I might able to add Silverlight 5 support. I was going through plugin library but I can't find where is the SL4 plug in code. Could someone point me to where is it hosted and any direction in adding support for SL5. If the work is already in progress, how do I go about help on this project.
Thanks a lot.
The support of Silverlight is implemented in the .Net Core Plugin of the .Net & C# Plugins Ecosystem.
Adding support for SL5 should be quite easy and should be only located on the DotNetConstants class.
If you manage to do what you want, feel free to open a pull request on the projet! :-)

Using Sharpdevelop Addin Architecture to develop WPF application

I am new to this AddIns architecture but it really seems fascinating to me. I downloaded shardevelop code to understand it but it is too huge and the examples given are using Winforms. I want to use WPF. Can you please provide me some links where they have used sharpdevelop with WPF?
Regards,
Priyank Thakkar
In most cases, SharpDevelop code base is your best resource.
BTW, did you check out MEF from Microsoft?
http://msdn.microsoft.com/en-us/library/dd460648.aspx

SilverLight / WP7: Can i use .net open source frameworks with silverlight & WP7?

Does anyone know if its possible to use standard frameworks etc in silverlight & WP7?
Or does it have to actually support silverlight specifically..??
Silverlight is a cut down verison of .net if i am not mistaken... so maybe all open source apis, frameworks etc may not work?
any ideas really appreciated
Thank you.
Unfortunately, you're right, a library has to support Silverlight specifically.
If a library is open source, you could try to build it yourself against the Silverlight runtime. If it doesn't depend on too specific stuff, you might be lucky to get it work after a few tweaks.

Convert WPF Application to SilverLight

Is it possible to convert an existing WPF Application to SilverLight automatically/with minimal effort?
I would argue that you CAN port Silverlight to WPF with minimal effort. I spent 2 hours porting and application I spent 3 weeks writing. I would argue that those 2 hours spent would categorize as minimal effort.
Sure, you need to create a new project, add the files to the new project and tweak them.
Since Silverlight is a subset of WPF its allot easier to go from Silverlight to WPF than the other way around.
For business logic and non-UI code your code should port almost straight across. I had some minor issues around authentication, as Silverlight 2 will pick up any authentication information in the browser, while in WPF you have to role your own login screen and manage cookies etc.
For the XAML it will port straight across if you don't style your controls. If you style your controls the use of the Visual State Manager, currently missing in WPF, will make things a little trickier. You can either re-style your controls in WPF using Triggers, or you can use the VSM implementation for WPF done by John Gossman. Microsoft have announced that they will add the VSM to WPF to make the two frameworks more compatible.
The perhaps most important reuse tough, is skills and experience. Since the two platforms are so similar you will be able to reuse all your skills in WPF.
I recently did a blog post about the Dive Log sample application and how I ported it from Silverlight 2 to WPF. Might give you some idea of the process.
Not really. I have found some articles regarding the multi-targeting option for WPF and Silverlight at the same time. At this moment, if you are not using PRISM, it is quite a challenge to target both of them, fortunately achievable.
What do you need to have in mind is that Silverlight uses a smaller (thus more limited) library than WPF.
In response to the comments:
Actually, there is already support for silverlight in PRISM (v2). The idea of PRISM is to provide guidance to developing applications not only using WPF but using Silverlight also - Prism V2 formally was known as Composite Application Guidance for WPF and Silverlight.
By using PRISM for silverlight capabilities, it would give you the warranty that your code would work on both platforms with minimal changes, if none (except maybe the different project types for visual studio).
But of course, if you already started developing your application, you would need to change your code to use PRISM.
Will and Bogdan's answers are correct. The keyword here is "minimal".
Rob Eisenberg has a list of differences here (though this was pre-RTW).
List of Differences in WPF & Silverlight
No. Silverlight runs in its own cut-down version of the CLR. It also is WPF-like, not WPF. You'll have to do a fair amount of work to convert it.
Times have changed. Check out Portable Class Libraries, now supported in .NET 4.0. You can build assemblies that can be used on different supported platforms: WP7, Silverlight WPF and even XBOX applications.
Here is a thread about this:
http://silverlight.net/forums/t/3898.aspx

Resources