Can I compile my Silverlight 4 application as a WPF? - silverlight

Just curious I heard this somewhere... I doubt it is true...

You can't do it directly, but you can create a WPF project and add links to the Silverlight files.
If you don't use Silverlight-specific code, you'll have a WPF application.

Related

how to use ProgressRing in a WPF application for windows

As simple as in the title, I'd like to know how to use a ProgressRing on my gui. I can't figure out how to import the Windows.UI.Xaml.Controls namespace in which seems to be located.
Thanks!
Eugenio
I don't think you can add a reference to a Windows Store Apps DLL to a WPF project, they are built against different versions of the framework.
You could however use a ProgressRing from a different WPF targeting DLL; MahApps Metro has one https://mahapps.com/docs/controls/progressring (source is on github so you can just take what is needed without having to jump fully into the metro style)
Or you could implement your own following a tutorial http://henryzhu1997.wordpress.com/2013/06/18/creating-a-progressring-for-wpf/

Is that possible to develop one application in both WPF and Silverlight?

I've already worked with WPF but i don't know anything about SilverLightnow I need to develop an application which can run on both Mac and Windows,so i was thinking to write an WPF Application with MVVM for Windows and run it on Mac Using SilverLight?Is that possible to port from WPF to Silverlight and how much work needs or maybe should I write the application with SilverLight from beginning,even for my Windows users?Which one is better and faster?
a quick answer is Yes..
but lot of things to do. You could share most of XAML view across platform but not all of them.
try to put all business logic into service layer like BAL or middle tier
put presentation logic into ViewModel class library
create separate XAML View (for SL and WPF)
there are several docs about target multi-platform here..
A Cross-platform WPF, Silverlight & WP7 Application at codeproject
Sharing Code Between Silverlight and WPF

XAML, WPF and Windows 8

I'm hoping someone here can explain to me the difference between WPF and XAML exactly in this context:
I have an application (an XBAP specifically) written in VB.NET using MVVM & Repository Pattern, implementing the the usual INotifyPropertyChanged, OLEDB etc etc.
The front end of the application is written in XAML.
From what I understand there is nothing specifically "WPF" about this application. In my view its XAML + VB.NET; where does the WPF come in? Given windows 8 and the "death of Silverlight/WPF" that I keep hearing about, what should I be doing to "upgrade" my application to ensure its future?
I would greatly appreciate someone clearing up this confusion for me.
XAML + your code behind is WPF. You are using WPF. XAML is the markup used for defining the interface in WPF.
And I wouldn't worry too much at this point about "the death of Silverlight/WPF". Just because Windows 8 supports HTML5/JavaScript doesn't mean WPF has gone away. At least, not yet.
See also.
An XBAP (XAML Browser Application) is a kind of WPF XAML application, that runs in the browser. Nothing more, nothing less.
WPF isn't going away anytime soon; in fact, it received a number of enhancements in .NET 4.5. Windows 8 will continue supporting WPF whether it's run on the desktop or as an XBAP. There's no need to "upgrade" your app, but if you want to take advantage of the Windows Store and the new user interface, it's not difficult to port your WPF XAML to WinRT XAML.
See, WPF can be called as the Successor of WinForms . In WPF WE have this XAML that is simply XML but Is more powerful and has greater properties .
WPF isn't dead !
Talking about Windows Store Apps, Silverlight has lots to do with WPF and XAML
Your XBAP application uses WPF : XAML for the UI and VB.NET for the code behind.
If you want to be sure, check if the namespaces you use in the code begin with "System.Windows".
Your XBAP is just a kind of project you can create with the WPF technology. (that's an application which shows several web pages as its UI).

How to use Silverlight SDK with WPF

as easy as it sounds,
How can I use the themes provided in SL SDk 4.0 into WPF project??
It should be easy!! Am I missing something?
While Silverlight and WPF are related they are not identical. Each has namespaces, classes and methods that don't exist in the other.
Simply copying the Silverlight xaml into your WPF project and fixing the compile errors is one approach, but I wouldn't recommend it. There are differences, like Triggers for example, that have no direct equivalent.

Exception when add Silverlight dll in WPF application

When i added the silverlight dll in the wpf application , i got the following exception.
Could not load file or assembly "System.Core, Version=2.0.5.0". The located assembly's manifest definition does not match the
assembly reference.
This is happening only in VS 2010 professional Beta 2.
You cannot use Silverlight directly in a WPF application, as they do not use the same version of the .NET Framework, thus the error message
Could you give some more details on your scenario ?
If you have a WPF app, you have more than what Silverlight can give to you.
If you are building a solution with multiple products, and one is WPF for the desktop, one is Silverlight for the Web, you need to create 2 different projects in VS.
Take a look at the source tree here:
http://expressionblend.codeplex.com/
Specifically, the Expression.Samples.Interactivity.Design branch.
This shows a few examples of how to put in property editors for use with Blend. I'm not sure if the same concept is transportable to the Cider design surface, but heck, Blend is nicer for pure XAML editing anyways. :)

Resources