Windows Phone Development uses wpf? - 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.

Related

how difficult is learning windows mobile development for winforms developer

Forgive me as this is not programming related question.
I know ASP.NET as well as WinForms development. I would like to know that if i want to learn windows mobile development how difficult it would be for me to start.
Is there a big difference between the two platforms ?
Is coding style and creating form design too different ?
If you know WinForms then you can most certainly rest assured that the Windows Phone platform will be a breeze to learn. I too came from a WinForms background and I found it pretty much a walk in the park to get in terms with Windows Phone. There are of course subtle differences in WinForms and Windows Phone such as Windows Phone uses Silverlight, which is a toned down version of WPF (Windows Presentation Foundation) which is in turn a powerful version if you like of WinForms.
But again, these are subtle differences and you will easily become comfortable using the Windows Phone API.
There are many tutorials on how to get started. Just google or youtube Windows Phone tutorial and you'll find many.
In terms of Coding Style, there are no real differences. The Windows Phone platform is obviously C# compatible so you can quite literally adhere to the same design patterns as you would with a WinForms application.
The main difference I suppose is the use of XAML. When designing a page, you can drag and drop controls which creates XAML.

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/

Good way for experience WPF developer to learn 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.

Convert WPF Application to SilverLight

Is it possible to convert an existing WPF Application to SilverLight automatically/with minimal effort?
I would argue that you CAN port Silverlight to WPF with minimal effort. I spent 2 hours porting and application I spent 3 weeks writing. I would argue that those 2 hours spent would categorize as minimal effort.
Sure, you need to create a new project, add the files to the new project and tweak them.
Since Silverlight is a subset of WPF its allot easier to go from Silverlight to WPF than the other way around.
For business logic and non-UI code your code should port almost straight across. I had some minor issues around authentication, as Silverlight 2 will pick up any authentication information in the browser, while in WPF you have to role your own login screen and manage cookies etc.
For the XAML it will port straight across if you don't style your controls. If you style your controls the use of the Visual State Manager, currently missing in WPF, will make things a little trickier. You can either re-style your controls in WPF using Triggers, or you can use the VSM implementation for WPF done by John Gossman. Microsoft have announced that they will add the VSM to WPF to make the two frameworks more compatible.
The perhaps most important reuse tough, is skills and experience. Since the two platforms are so similar you will be able to reuse all your skills in WPF.
I recently did a blog post about the Dive Log sample application and how I ported it from Silverlight 2 to WPF. Might give you some idea of the process.
Not really. I have found some articles regarding the multi-targeting option for WPF and Silverlight at the same time. At this moment, if you are not using PRISM, it is quite a challenge to target both of them, fortunately achievable.
What do you need to have in mind is that Silverlight uses a smaller (thus more limited) library than WPF.
In response to the comments:
Actually, there is already support for silverlight in PRISM (v2). The idea of PRISM is to provide guidance to developing applications not only using WPF but using Silverlight also - Prism V2 formally was known as Composite Application Guidance for WPF and Silverlight.
By using PRISM for silverlight capabilities, it would give you the warranty that your code would work on both platforms with minimal changes, if none (except maybe the different project types for visual studio).
But of course, if you already started developing your application, you would need to change your code to use PRISM.
Will and Bogdan's answers are correct. The keyword here is "minimal".
Rob Eisenberg has a list of differences here (though this was pre-RTW).
List of Differences in WPF & Silverlight
No. Silverlight runs in its own cut-down version of the CLR. It also is WPF-like, not WPF. You'll have to do a fair amount of work to convert it.
Times have changed. Check out Portable Class Libraries, now supported in .NET 4.0. You can build assemblies that can be used on different supported platforms: WP7, Silverlight WPF and even XBOX applications.
Here is a thread about this:
http://silverlight.net/forums/t/3898.aspx

Resources