I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life using .NET 3.5 SP1 ? Any pitfalls (such as the "airspace problem")? Any hint on what appoach works best?
There is an addition in 3.5 SP1 that allows better interaction between DirectX and WPF (D3DImage), and one way to get to that is through XNA.
Here are some details:
http://jmorrill.hjtcentral.com/Default.aspx?tabid=428&EntryID=259
XNA integration is high on our list of things to add to WPF so we're looking in to this for future versions. Stay tuned (to GregSc's blog) for the details as they become available.
Ian Ellison-Taylor
Read more about this here
Thamir Khason presented a excellent session about WPF/XNA/Silverlight at Tech-ed... Here is his slides:
http://blogs.microsoft.co.il/blogs/tamir/archive/2008/04/14/my-teched-08-presentation-slides-download.aspx
PS. This was quite impressive to see... he had a game that ran on the xbox. On his desktop using WPF to host XNA and ons his mobile phone using silverlight all playing against each other!!!
You want to use a D3DImage, but D3DImage works different on windows XP vs windows Vista or 7.
On Vista or 7, you create a NON-lockable renderTarget to use with the D3DImage & you use a Direct3D9EX Device.
On XP, you create a lockable renderTarget to use with the D3DImage & use a normal Direct3D9 Device.
Also insted of using XNA it might be better to use SlimDX if your just making this for the PC. SlimDX is not lacking any Direct3D features & supports Direct3D 9, 10 & 11.
http://slimdx.org/
I personally would advise against trying to do this integration. I know what you're going for ... the ease of defining GUI/HUD elements in WPF greatly outweighs trying to do the same in just plain old XNA. However, think realistically of the time you'll spend trying to enable this scenario vs. how much you'd save if you just did everything "natively" in XNA. Also (and this may not be an issue for you), WPF isn't supported on the xbox or zune ... so you'd be limiting yourself :-)
Hey I know this is a while after you posted but if you are still looking for a WPF solution for XNA you may want to keep an eye on http://red-badger.com/product. The XPF soloution puts wpf into XNA. SO have a look, at the moment it is free as it is in beta but that will be changing as they add more components
Related
I am new in windows phone development.
I really have some doubts,
Is WPF is actually using for the windows phone app development ?
I am just confused about to reply to one who ask "Which platform or technology will use for developing windows phone apps ?".
I hope to get a good clear reply here.. I googled it many times. but I didnt get any clear idea yet about this.
Thnks.
No, WP7 development does not use WPF. It uses Silverlight (or XNA for games).
However, the two are quite closely related. WPF was developed in 2006 and introduced the concepts of bindings, creation of UIs via XAML, visual trees, animation, dependency properties and much more. Many of the WPF concepts were re-used by Silverlight, the web-based plugin. Whilst WPF and Silverlight are similar, they are not the same. Despite this, with a little effort, code sharing between the two is possible.
See the following question for more references:
Getting Started with Windows Phone 7
Windows Phone 7 applications can be written using Silverlight or XNA.
With Silverlight you use XAML to create your user interface (as in WPF), but there are couple differences between these 2 technologies: Contrasting Silverlight and WPF.
I'm evaluating Silverlight for a RIA right now. A large amount of the Gui is to be designed by people without programming skills. Visually the application should be very appealing, animations, smooth transitions and so on are a big plus for us. Blend and Silverlight seem to be tailored very well to fit this requirement. However it does need the runtime which is somewhat acceptable for us but also a little disadvantage.
So, do you know an mature Ria-like alternatives (similar ease of development, all-in-one-happy-package without runtime) outside of this ecosystem? I had a look at Qt and the designer but I'm not sure what to make of it in the moment with all the buzz about it and if it is fitting to our needs.
Are there other alternatives you can recommend?
Thanks in advance.
If you're familiar with .NET technologies and looking at Silverlight from that perspective, its may be the way to go in that you will be using the same tools. Silverlight is also cross-platform on desktops.
Adobe Air as far as I can tell can be many things, one or more combininations of flash, flex, javascript, html. This is also cross platform in terms of desktop machines.
Html/jQuery/Javascript is another option, this also enables usage on mobile devices.
There are 3rd party plugins/add-ons and components for most of these technologies that help with both features and the visual aspect of the interface.
There is Adobe AIR, but I'm not familiar with it.
Just so I understand, here is what I hear you saying: you want designers to design the UI and developers to develop the code.
Your problem is that developing for Silverlight requires the Silverlight runtime? I'm not sure I get this, but here are some thoughts:
1) If your designers are running Windows you can install just Expression Studio and Blend should include all you need for them to do their work in Blend.
2) If your designers are NOT running Windows, they can't use Blend. They can still do their design work in Adobe Illustrator and Photoshop because those assets can then be imported into Blend. Of course, whoever does the import will need a Windows machine with at least Blend installed: in that sort of scenario we call that person an "integrator", and there are folks out there who specialize in that sort of work.
3) If your developers are going to create Silverlight applications, they will need Windows and .NET developers tools (preferably Visual Studio). To paraphrase what AnthonyWJones said earlier: how can you develop for a platform without having the platform?
In my mind, having Visual Studio and Blend is the "all-in-one happy package", but that's just me. :)
I am a 6-years .Net Developer, and want to know which is better to start learning first, Silverlight or WPF.
I know this question seems a little-bit argumentative but since Silverlight is a mini-version of WPF. I think this takes away the argumentation.
So in the light of that, if I considered start learning:
Silverlight First: Because it would be easier to learn than its big brother.
WPF First: Because it would be easier to know the basic concepts and event-model of WPF before moving to SL.
Learn Silverlight first so you won't be annoyed that you cannot use useful things like RelativeSource and x:Static in Silverlight :P
Silverlight will be fused with WPF in a couple of years.
Study Silverlight first, i recommend the book Pro Silverlight 4 in C# from Apress, the unique that have color pages.
If in future you'll need some extra Windows functions, go to the much complete WPF.
With Silverlight you can also develop Windows phone 7 applications, and Xbox 360 (rumored). In windows 8 will be a Silverlight Marketplace (valid rumor), and you can create very rich applications / part of website / full websites instead of using the slow, crappy and "browser inconstistent" JQuery+Canvas that have no tools at all for design (and when it will have, Silvelight 5 will have real 3D and better tools).
Also the fact to use the same language for client and server is priceless.
Well Silverlight and WPF is "pretty much" the same actually. As you said Silverlight has only a subset of the .NET framework but it doesn't make it "simpler" than WPF.
The biggest leap you will have to make in order to learn those languages is learning XAML, which is the same in both.
It all depends on what you need to do. Do you want to publish your project to the web, then go with silverlight (you can do a XBAP project in WPF to publish it to the web, but clients will need Full .NET Framework). If you need advanced .NET functionnality, then use WPF.
Silverlight first. It is easier to add the extra WPF features than to unlearn things when doing WPF first.
Having said that, it doesn't matter that much. There is more on Silverlight on the web these days.
What kind of applications do you want to write ? Desktop applications that need local access or web based applications ?
If it is a matter of learning, I would learn both in parallel. Keeping your application consistent to run in both run times will force you to learn all of the little differences. Once you get past the main SilverLight features, shift into the features only provided by WPF (though I would start with the libraries likely to be included with SL5, first, such as 3D).
Go with Silverlight first, although it is not as feature rich as WPF it is simpler. Also Microsoft are actively evolving the platform. Silverlight is not a true subset of WPF as it had things like a DataGrid control first.
Good learning resource: http://www.silverlight.net/learn/ together with the Pro Silverlight book which you already have.
The further advantage of starting with Silverlight is that it will be easier to develop for the new Windows phone (broadly it uses an older version of Silverlight).
Learn both at the same time! Not one or the other, but both. There's plenty of overlap between the two technologies which should make it more practical to focus on both at once.
I am about to start development of a multi-touch application.
I need to decide between WPF and XNA.
Which would run faster ?
WPF already has libraries to support multi-touch via TUIO input.
Does anyone know a similar library or even just sample code to
drag/rotate/move objects in XNA ?
Thanks!
SW.
Touch is just another way of getting input from the user. Whether you route this input to an XNA app or WPF app depends more on what you want to do in the app.
XNA is a lower level api for doing 2D/3D on Windows, Xbox and Zune. WPF has only a higher level support for doing 3D and targets (currently) only Windows. So going with XNA vs WPF is imo more a decision of graphics requirements and platform support.
Since your app is graphic intense it could be more efficient to work at a lower level (read XNA or even SlimDX/DirectX). Reimer's XNA tutorials have a lot of great articles for starting out with XNA.
If you use XNA, you're going to be doing a lot of math to manually analyze the touch information - I'd check out WPF first (or perhaps you can host XNA visuals inside WPF and use WPF's touch input engine)
The Bespoke MultiTouch Framework supports multitouch and XNA together. Paul has a number of XNA samples already built to demonstrate the features you are looking for :-)
I'm starting a hobby project in which I would like to have a graphical, touchscreen interface for interacting with a kiosk-like device running on top of Windows XP Embedded. For development of a rich UI experience, I was considering using WPF. However, a number of demonstration videos that I have come across have used Silverlight, while I haven't seen a single WPF demonstration.
It was my understanding that Silverlight was targeted towards website developers, while WPF was more targeted towards desktop development.
So this question has two parts. Firstly, what is the recommended graphical subsystem for development of a rich UI experience on a kiosk-like device hosted on the Windows XP embedded platform? Secondly, if it is Silverlight, which version is suggested (1.0 or 2.0) and why?
It seems that WPF works fine on embedded. See here the second comment.
I think that your choice should be dependent on the type of kyosk you want to build. Some kyosks are just an open browser page. And then you have stuff like Microsoft Surface that can be used like an horizontal kyosk :-)
I would recommend also WPF, have done few kiosk apps using it.
also I would recommend http://fpscomponents.com/Product.aspx?id=8 as a virtual touch screen keyboard software component. it's done in WPF and very flexible and customizable.
User can define custom theme(skin), layout and language of keyboard. guys are working with customers and hear theirs voice so any suggestions might be accepted.