how do I embed an existing xna 4 app into silverlight 5? - silverlight

I've been struggling with this for a while, I have an XNA 4 app running just fine and I'd like to embed it into silverlight. I can't find any information on how this could be done (pretty much everything I've googled has been about silverilght 5 beta where silverlight 5 RC has changed code and stuff).
Any ideas?

Silverlight 5 supports limited subset of XNA and cannot execute existing XNA apps as is. You would have to port your application to Silverlight 5. Latest silverlight toolkit (Sep. 2011) provides templates, samples and integration with XNA content pipeline to help you started.

For instance, the current Silverlight implementation of XNA supports only shader model 2.0 It means no more than 64 shader instructions among other limitations.
I understood that we could maybe have shader model 3 while under full trust for the final release but nothing certain here...
But more important is that a SL app is a web delivered app. Therefore you don't want to donwload 200Mb of data before being able to play a SL game. Streaming of game resourcesis mandatory... and requires architectural modifications.

Related

Is Silverlight recommended for new development?

At my job we are developing a GIS application which will be developed using Silverlight + .NET
But, I heard that Silverlight will not be supported by Microsoft as also they are stopping Silverlight, is it true ?
Is it suggestable to use Silverlight if so with which version of silverlight we can use. ?
Thanks.,
Use Silverlight 5. Current version have 10 year support, and it better than Flash, java or damn it html.
In the future you can migrate to another .NET-based framework by easily porting code.
About silver light support, you can find these answers from Microsoft Silverlight Support Lifecycle Policy.
Keeping in mind that MS would support these browsers till 2021, I would recommend using Silverlight5 if you really have to use Silverlight.
However for new developments I would recommend you to evaluate Html5 as well.
YES! Silverlight is still the best technology to use for web based Line of Business applications. Silverlight will be supported for another 10 years and it will be available within Windows 8 desktop. Silverlight +[Arc]GIS are a great combination. It is so easy to create full functioning application and with little effort. Silverlight is not dead. It is still a great technology to use that is available on (almost) every platform.
Ultimately it comes down to:
1) What do you know: Are you an HTML/JavaScript ninja? Then use that, do you know Flex better then your own children? Or are you a skilled .Net assassin?
2) How much time do you have? Do you want to learn something new and have gobs of time? Then go for that new shiny object (HTML5) and get yourself some street cred.
This probably belongs on programmers.stackexchange.com. However:
Silverlight will continue to be supported for some time, but all signs point to it no longer being actively developed.
If you want a technology that's actively developed, I'd recommend HTML 5 for web based applications and WinRT for Windows 8+ native applications.
Ultimately, though, you should go with what works best for your situation. After all, WinForms is still used on many successful greenfield projects.
Silverlight is based on the NPAPI architecture that is no longer supported on Google Chrome (from browser version 42 upward) though you can still run it on IE and Firefox. HTML5 is supported on all browsers.
From a career standpoint, using Silverlight (which uses XAML) gets you an easier entry into developing apps for Metro/Windows Store/Universal Windows Apps (these can be developed using HTML5/JS too but you'll find a larger developer base using C#/XAML).
Finally if you're already a WPF developer, it's fastest if you develop for Silverlight. See Silverlight vs Flash vs HTML5.

Building both a Silverlight 4 and WPF app

We're building a Silverlight 4 LOB application. However, we're concerned that not all our clients will be able to support Silverlight. For example, most of our clients will be large companies and it's possible their IT department hasn't authorized Silverlight to be installed on user machines. And it's possible that some of our clients will have installed 64 bit versions of IE on user machines. Both of these situations would prevent our clients from using our app.
To deal with this possibility, we'd like to build our app in such a way that it could easily be hosted as a WPF application, if we had to drop back to that position. Our middle-tier and backend would be the same, regardless of the client used.
We're going to initially build our app to be a Silverlight app. A WPF version would come a bit later. My question is this. What precautions should we take, when building our Silverlight app (UI), to make sure the app easily ports to a WPF app (using ClickOnce)?
WPF is (near enough) a superset of Silverlight, so it should be easier going from Silverlight to WPF than it is going the other way. As long as you are using an MVVM framework which abstracts over any platform specific features, then porting the code will be simplified (I would recommend Caliburn.Micro).
Rocky Lhotka (the author of the CSLA business object framework) has a nice blog post on some of the differences between Silverlight and WPF, and things to consider when targeting both platforms.
One of your problems will be solved by Silverlight 5, since SL5 plugin will work in the 64 bit IE.
Porting from silverlight to wpf shouldn't be too hard. One thing you can do to guard against possible issues is to get 3rd party library of ui controls that work on both silverlight and wpf. I'd sugest to start with silverlight and move to wpf only if you see real push back from your clients.

Adobe flex or WPF to write a visually rich desktop application

I'm interested in making a desktop application which I would want to use as a Desktop Manager. This kind-of goes to Desktop Enhancement Category. My requirements are:
Application has to be visually rich, with panels sliding,fading,wiping,rotating and etc.
It should also support flash playback. (swf, flv)
Animations/Transitions should run smoothly.
Lower CPU Usage.
My question is which is a better option to build this application. Microsoft's "WPF" or Adobe Flex(running in Adobe Air to run on desktop). And also respond as why it is better.
Be suspicious of anyone who will give you an answer like "Definately use xyz" to this question. There are pros and cons to both sides.
First, I think you might be confusing what WPF and Air are... WPF is a presentation layer on top of the .Net framework, where Air is a framework by itself. Apples and Oranges. If you want an analog to what Air is for the .Net stack, you probably want to look at Silverlight Out-Of-Browser, which is a much closer comparison to Air.
What is the difference, then, between WPF and Sliverlight OOB? Again, WPF sits on top of a very large .Net framework where Sliverlight OOB is a very light framework (in comparison) like air. It is the difference between a 200 MB download/install and a 12 MB download/install.
So, that being said, I think you should also ask what platforms this needs to run on. Silverlight OOB runs on Mac and Windows where WPF only runs on Windows. Air runs on Mac, Windows and Linux.
The next thing that I see is that you need to do SWF and FLV playback. This will be easier to achieve with Air, since it is native. You CAN do this with Silverlight OOB but you will find yourself rigging something up where you host an HTML control and run the flash movie inside the HTML control. It is a bit more clunky, but it will work.
Other than that, Air and SLOOB are very similar in features. It then comes down to your team and the expertise, IMO. If they are already familiar with the WPF/Silverlight, then a SLOOB app is well suited with minimal ramp-up. If your designers are more familiar with the Adobe suite of tools, then it might be easier to build a shiny app using Air.
In all, the decision between Air and Silverlight/WPF really comes down to preference. That is, once you get past any particular techincal limitations like the flash playback or OS support.
Hope this helps,
Brian

Is it possible in Silverlight to stream a live video screencast of the desktop?

I would like to develop a web conferencing system (or web classroom) as a graduation project using Silverlight similar to
iVocalize
which is a java applete .
I don't know if what is possible for a java applete to perform on the PC is also possible for Silverlight, or is SL more restricted.
There are two functionalities (which are related i guess) that iVocalize provides which i would also like to include in my SL application, which are:
A participant may broadcast a live video stream of the desktop to other participants so that they will be able to follow all activities performed on the computer.
A participant may take a snapshot of the desktop
If the previous functionalities are not possible in SL than do you think that WPF may be used instead?
Thank you vey much.
Actually, you can use Silverlight 4 Web cam features.
With Silverlight 4, you can develop full-trust Silverlight application that can capture the snapshot of user desktop.
Using Silverlight it is possible.. Have a look at this open source silverlight project. Its has desktop sharing as one of the module
http://silverlightvideochat.codeplex.com/

WPF vs Silverlight 3.0

Silverlight 3.0 beta has just been announced at Microsofts Mix Conference in Las Vegas.
Two features of the new beta are 3D-graphics and the ability to run applications outside of the browser, which to me seemed to be two of the major features that WPF (Windows Presentation Foundation) previously offered over silverlight.
I am currently evaluating WPF and Silverlight for possible use in our companies future development activity, and this announcement has left me confused as to the intended direction of these two UI technologies and why I would choose one over the other.
Has anyone implemented a new application using WPF recently, and if so, what drove you to that decision? Given the announced changes to silverlight, Would your decision have changed had you made it now, and if not, why?
Any advice would be appreciated.
The biggest difference I find is the asynchronous model you have to adopt
in your Silverlight application.
It does seems like an advantage (and it can be), but it does make
life very difficult sometimes.
There are also some limitations that can be a real challenge like the absence
of print support.
I would recommend Silverlight over WPF when:
- There is no need for best possible performance (graphics included)
- Can get around the absence of print support (it will come, we just don't know when)
- Camera/Microphone support is not needed
- Can tolerate the assync app/development model
- Can tolerate limitations on WCF (no support for WS-Security at this point)
- There is no need to store huge amount of data on the client.
- There is no need to direct integration with client side applications like Office.
- Has a server to host your application
I would say the main difference is that WPF requires the client to have the .Net 3.0+ framework. Silverlight only requires the runtime. Now that being said, WPF is geared more for controlled environments such as an intranet. Silverlight is meant for the public web. Another difference is that Silverlight is cross platform (Windows, Mac, Linux in the future & Cross browser). WPF is meant for Windows only.
The .Net framework can be a huge download for some users. Silverlight is only 4-5MBs. This is a big difference to run your app on the web, but not a big issue if its an internal application at your company.
Silverlight is Sandboxed which is meant for web use. So if your app requires more permissions you will need WPF.
There are also some differences between Silverlight code and WPF. But from what I've heard, the ultimate goal is to get a Silverlight to run inside of WPF with minimal code changes. But they aren't there just yet.
I have just worked on a WPF project that in hindsight we feel we might have chosen SilverLight for. It is probably more important to know the differences and select the one that is most appropriate for what you're doing.
Here's my starter for ten on some of the important differences - there were originally some differences in the available controls, but that has largely been smoothed out now.
Silverlight
Runs entirely on the client with AJAX
calls to the server for data
Can run on any server, including Windows and Linux / Apache
Uses COMPACT .NET framework
WPF
Runs on the client... usually calls services for data
Runs on Windows XP / Vista with .NET 3.5
Utilises the entire .NET framework
Silverlight is basically a stripped down version of WPF in order to make the runtime libary download as small as possible.
As a result, WPF simply has a lot more functionality available in it and tasks that are simple in WPF often become not so simple in Silverlight.
If running as a web app is not a requirement then the decision is a no-brainer - WPF all the way.
Has anyone implemented a new application using WPF recently, and if so, what drove you to that decision: Well since WPF was desktop only (or browser based using XBAPS - but that was more a deployment system than a real system) that was a good reason to it.
"Would your decision have changed had you made it now, and if not, why?" - No Silverlight, even on the desktop in v3, is still highly sandboxed and so certain functions are going to be hard/impossible to do due to the sandbox. Also the ability to use DirectX parts in WPF will still give another optimisation area which Silverlight and it's 3d won't be able to use.
It's worth noting that Silverlight's 3D is not the full 3D support of WPF, but only projection of 2D into 3D - i.e. take the 2D plane and allow rotation in X, Y & Z directions. WPF has full 3D modelling with materials, view ports, lighting and camera positional support etc.
I'm well along in the development of our first WPF app for release. Silverlight 3 looks great, but for this application I would still have chosen WPF. The application centers around presenting and manipulating very large sets of images hosted on a central server on our clients' networks. Additionally, the software update/change rate will be minimal. Mass import of new images from a local drive, no Internet connectivity requirements, performance concerns, etc. make this a project well suited for WPF.
One of our upcoming projects, however, will require many remote users to access a single data store on our network. The data they work with requires significant validation and error handling, so running that code locally is ideal. They will need the ability to work both on and offline and remain in synch (probably with SQL Data Services). SLOOB (Silverlight Out Of the Browser) will most likely be our choice for that one so they can have all the Silverlight advantages but use it like a regularly installed application, even without an Internet connection.
Both formats have their place: the trick will be to avoid using Silverlight for everything - we have more tools than just 1 hammer. :-)
Another difference is that with SL you only have one 'window', you can't have dialogs (they can be simulated but their size is limited to the main window) and you can't add multi monitor support.
If you have to interact with existing business applications (e.g. open a document in the archive viewer) you need to use WPF.
I recently have built several internal tool using wpf, and I chose it simply because It was easier for me coming from win32 work. I don't really think that the differences are major, and really... everything i have seen/heard indicates that porting between wpf and silverlight is quite easy.
Storage: You only have 25MB of isolated storage out-of-browser. If I remember correctly from some mix09 video, this limit is lower if your app is in-browser.
http://bliny.net/blog/post/Out-of-Browser-with-Silverlight-3.aspx
No FlowDocument: So there are limitations there too.

Resources