views:

132

answers:

4

Hello, I would like to get into programming with C# and Silverlight. I have read up a lot on WPF and like it a lot (from my narrow viewpoint)

Here is the question I have: if I understand WPF principles correctly, then I can seperate UI from logic.

I also can seperate logic from animation in my app (using Silverlight for animation, C# for logic)

Am I correct in this understanding?

Right now I am looking through some tutorials on Silverlight but I am asking for some pointers on how to make these all talk to one another. In my WPF app, how can I use Silverlight to do animations?

If anyone has a good book or resource, I would really like to read it. Thanks for any help :)

Tools I have are: Visual Studio 2010 and Expression Studio 3 (I can get 4 and install the trial if I am supposed to use it instead of version 3)

+7  A: 

There is a slight misconception here.

You wouldn't use Silverlight within a WPF application. It's really one or the other - Silverlight is an alternative platform to WPF.

If you're using WPF, you can use WPF for all of the animation. If you want to run within a browser, and/or have the deployment advantages of silverlight (cross-platform, simple deployment, etc), then target Silverlight. Silverlight development is similar to WPF development (many of the concepts are identical), but it's a lighter-weight platform which is sort of like WPF minus some features (with some extras thrown in, too).

Reed Copsey
Well, it *is* possible to use Silverlight in a WPF app... but I don't see any reason to do it
Thomas Levesque
@Thomas: Yeah, it is - though it's very clunky at best. You're really "hosting" silverlight, and it's entire runtime, within a WPF application, you're not using Silverlight to "animate" WPF, though, which was what the OP seemed to think...
Reed Copsey
Berryl
@Berryl: You can reuse a lot of the code, especially if you stick to the Silverlight subset of WPF. You can even, potentially, reuse Views. Check out Prism's source code for one approach (using partial classes and 2 projects, but the same .cs files, etc).
Reed Copsey
+3  A: 

Check www.silverlight.net there are lot of nice video tutorial.

Incognito
A: 

Silverlight is the browser-based implementation of XAML and WPF technology. It represents a subset of the capabilities of WPF. So you can accomplish everything you need for a desktop app just using WPF. The experience you gain will translate to Silverlight development when you need to create browser-based applications.

David
Silverlight's not just browser based anymore. It runs OOB as well.
Reed Copsey
@Reed, Thank you for clarifying, I am aware of this. The point remains that silverlight is a browser-delivered platform that has a subset of the WPF functionality. This distinction is important because a completely different runtime is used to host silverlight assemblies and while .net 4.0 allows some ability for .net to reference silverlight assemblies, it is only possible for a tiny overlap of the class library.
David
OOB = Out of Band??
Berryl
@Berryl OOB = Out of Browser, or OOBE = Out of Browser Experience, see http://channel9.msdn.com/posts/Charles/Joe-Stegman-Silverlight-4-Out-of-Browser-Evolves/
David
A: 

Yeah you need to decide between Silverlight or WPF. For heavy Windows graphics or a GUI Client, I'd pick WPF. If you're looking for more of a web application. I'd go with Silverlight because of the difficulty of configuring WPF XBAP applications. I'd probably try to writing it in silverlight and then if I ran into something I couldn't do in silverlight, convert it over to wpf to go from there due to silverlight being lighter weight and cross platform.

Dave Hanson