Good way for experience WPF developer to learn Silverlight - silverlight

I'm a developer with WPF experiences, my next project will use Silverlight. I have read some articles on the internet (almost all msdn and silverlight.net) and I think that they aren't much different. Anyway, I still have questions that I'm not sure.
What is different between WPF 4 and Silverlight 4? (I found an article on msdn but its based on .NET framework 3.5)
Are there any resources for learning Silverlight that are good for experience WPF developer?
Do I need a book on Silverlight?

I personally really like the course posted here:
http://channel9.msdn.com/learn/courses/Silverlight4/
I don't know what you intend to develop using Silverlight. But it's a good start if you like to develop business applications using Silverlight.

WPF has hardware-accelerated full faceted 3D support
WPF has direct access to the full .NET framework
WPF can take full advantage of the hardware on the system.
Silverlight allows you to create a single app that works across browsers, operating systems.
You can use Silverlight for Windows Phone 7 development
For Books, I would recommend Silverlight Recipes and Microsoft Silverlight 4 Data and Services Cookbook.

Related

Windows Phone Development uses wpf?

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.

MVP or MVVM framework for both WPF and .NET CF 3.5 development

I am creating a draft architecture outline for a disconnected client-server platform, that involves multiple different client types. I need to support: web clients, desktop workstations and mobile devices (WM 6.x now and Android later).
I am searching for a MVP or MVVM based framework that would let me to reuse as much of the code and architecture as possible between clients, while:
using WPF for desktop development
using .NET CF 3.5 for Windows Mobile development
This framework does not obviously need to support Android, however I am considering Mono for Android to develop the Android client (for easier maintenance of the whole platform), so portability would have been an added asset.
So far I ruled out:
Prism (does not support WM based mobile devices - Windows Phone 7 only)
MVC# (does not support WPF)
I would appreciate any hints that would aid in researching the subject further.
These MVVM Frameworks work with Windows Phone 7:
Caliburn Micro
MVVM Light (it doesn't advertise it, but I've been to a demo where it was used on WP7)
ReactiveUI (Uses the Reactive Extensions for .NET)
My personal favorite is ReactiveUI, but if you've never used the Reactive Extensions it can be a brain burner at first.
As for UI Composition (you mentioned Prism), there aren't a lot of options, mostly due to reflection restrictions on the phone. I have seen an article where someone got basic MEF working on the phone and MEF is probably all most people need in this situation. You can check out that article here.
Hope this helps.
In my opinion, this would be a custom Framework with a mix of UI Processes for different client types. The business logic or entities can definitely be reused to suit the needs of the view.
I did the same research and I concluded the following (which I did not implement yet):
There aren't any open source MVVM frameworks that support .NETCF. You
can only find MVC or MVP, but not MVVM.
Suggestion: get the source code of an Open Source MVVM framework that supports the Full/Desktop .NET, and see if you can adapt it(so that it recompiles) to the .NETCF. I found the following two, which also support the other platforms that you mentioned:
MVVM FX for Windows Forms and Visual WebGUI - Home
MugenMvvmToolkit
Other than that, I don't see any other way of doing this.
HTH,
MVVM wouldn't make much sense in Windows Mobile + .NETCF since you don't have INotifyPropertyChanged and implementing Model-View-Presenter in WPF or any INotifiyPropertyChanged supported framework wouldn't be as effective as Model-View-ViewModel
You can share assets between the full and compact framework by moving most of the business logic into a seperate class library (or several) that target the .NETCF. You can reference a .NETCF library from a full framework project, but not the other way around.
Check out this very good article by Daniel Moth describing how to share assets between the compact and full framework:
http://msdn.microsoft.com/msdnmag/issues/07/07/ShareCode/default.aspx

WPF/Silverlight which to start learning first?

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.

Question regarding WPf/Silverlight/Windows Phone7 Developemt

I have experience coding in C# (console and Windows Form applications). For something to do in my free time, I've been intending to pick up another language, and have my sights on something thats a little more content rich. However, I'm confused about the following:
Windows Forms are used to develop GUI applications for windows. What is WPF and how is it different from Windows Forms
Does Windows Phone development use C#, or exclusively Silverlight? Or does it just use the .NET framework, and you can use either of the two?
Adding to other answer(s):
WPF uses an XML-based markup called XAML to describe the UI, like HTML does for a web page. The XAML file is paired with a "code-behind" (.cs or .vb) file that is compiled together when the app is built. Adding an XML element to the XAML file is equvalient to declaring an object in the code-behind file. For many classes, you can choose to do one or the other.
Use can use C# or VB.NET language to write Windows Phone apps (although currently only C# is available in the free Visual Studio Express that comes with the Windows phone tools on App Hub). Silverlight is a subset of the .NET Framework, whose classes can be used to write phone apps. You can also use the XNA libraries to develop phone applications.
I HIGHLY recommend Charles Petzolds free ebook for more. He does a great job of explaining this in the first couple chapters: http://charlespetzold.com/phone/index.html
Hope that helps!
Win Forms are a light object oriented wrapper around the basic Win32 GDI primitives.
WPF and Silverlight do their own rendering, don't use GDI and are built on XML-based layout and the MIL.
Windows Phone Development uses Silverlight with C#. The WP7 version of Silverlight runs on a modified version of Silverlight 3, which in itself uses a modified/minified .NET framework. So WP7 development uses all of what you mentioned in question 2.
I can't give a much better answer than #jeffmaphone for question 1, so please look at his response.
Windows Phone 7 uses Silverlight for the UI but the code can be C# or VB. This page of Code Samples for Windows Phone has both but:
In order to build and run Visual Basic samples, you must install additional developer tools. For more information, see Installing Windows Phone Developer Tools.
For more information see the Windows Phone 7 Developer Guide
1) Windows Forms is one method to develop GUI apps for Windows, WPF is another (for Vista, 7 and XP SP2). In general, Windows Forms is great for simple, quick and dirty applications, while WPF works well for more complex and flashy applications.
2) Windows Phone uses Silverlight for non-game applications and XNA for games. In both cases, you can use C# as the logic layer. In other words, C# code decides where to put things in the UI, while Silverlight or XNA are different ways of talking to a display.
Be careful about searching for Silverlight tutorials, because not all of Silverlight is on the phone.
Here are my suggestions:
1) Check this discussion :WPF versus Winforms
2)Generally Windows Phone 7 supports two frameworks for developing applications– Silverlight and XNA. Check MSDN for reference:
The Silverlight and XNA Frameworks for Windows Phone
Features Supported in Silverlight for Windows Phone
PS: One of the best resource for Silverlight development is the official Silverlight web site: http://www.silverlight.net/

A good Silverlight 3.0 reference application, with source?

Having never written a production quality Silverlight app, I am looking to find a quality open source reference application for Silverlight 3.0 (Silverlight 4.0 is no good as I have VS2008) to help learn Silverlight.
Ideally I'd like to see:
a line of business application, in the client-server tradition.
SQL Server back end
no use of 3rd party libraries like PRISM or CSLA as I would like to see how the core Silverlight technologies work.
I realise there are plenty of open source projects on Codeplex, but struggled to find any classic line of business apps there.
This is a really good one:
http://timecard.codeplex.com/
The following does use Prism, but you can learn a lot from it. It even shows localization:
http://happynet.codeplex.com/
In all honesty, get yourself upgraded to VS 2010. If you are serious about becoming a professional in Silverlight development, version 4 has the most bang-for-your-buck.
Not all the newer technologies are supported for Silverlight 3 and all the latest cool tutorials and project examples tend to be in VS2010/SL4.
You also should not ignore patterns like MVVM and libraries like Prism & MEF as they are rapidly becoming commonplace for Silverlight projects. There is more danger of you getting into Win-forms-style bad habits if you use a Win-forms style approach to Silverlight at first.
Here is a simple explanation of MVVM for Silverlight:
http://openlightgroup.net/Blog/tabid/58/EntryId/89/Silverlight-View-Model-Style-An-Overly-Simplified-Explanation.aspx
These videos are a good introduction to creating/understanding Prism-based projects, specifically for Silverlight:
http://channel9.msdn.com/posts/mtaulty/Prism--Silverlight-Part-1-Taking-Sketched-Code-Towards-Unity/
It includes him building an Outlook-style application using prism (with full source provided).
The codeplex project, full source and documents etc, for Prism and soon MEF is here:
http://compositewpf.codeplex.com/wikipage?title=Getting%20Started&referringTitle=Home
Prism was created by Microsoft and will soon have a final release of version 4 (including MEF).

Resources