1

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)

4 Answers 4

7

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).

Sign up to request clarification or add additional context in comments.

4 Comments

Well, it is possible to use Silverlight in a WPF app... but I don't see any reason to do it
@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...
I'm assuming a non-trivial application that had some separated implementation of a c# domain model is reusable, and that the Views for WPF & Silverlight would necessarily be different, but how about your ViewModels? Do you try and reuse the code for both platforms, again assuming your app has a reason to be on both platforms, or have different vm implementations? Cheers
@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).
3

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

Comments

0

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.

3 Comments

Silverlight's not just browser based anymore. It runs OOB as well.
@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.
@Berryl OOB = Out of Browser, or OOBE = Out of Browser Experience, see channel9.msdn.com/posts/Charles/…
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.