简体   繁体   English

有关WPf / Silverlight / Windows Phone7 Developemt的问题

[英]Question regarding WPf/Silverlight/Windows Phone7 Developemt

I have experience coding in C# (console and Windows Form applications). 我有使用C#(控制台和Windows Form应用程序)进行编码的经验。 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: 但是,我对以下内容感到困惑:

  1. Windows Forms are used to develop GUI applications for windows. Windows窗体用于为Windows开发GUI应用程序。 What is WPF and how is it different from Windows Forms 什么是WPF,它与Windows窗体有何不同
  2. Does Windows Phone development use C#, or exclusively Silverlight? Windows Phone开发是否使用C#或仅使用Silverlight? Or does it just use the .NET framework, and you can use either of the two? 还是仅使用.NET框架,就可以使用两者之一?

Adding to other answer(s): 添加到其他答案:

  1. WPF uses an XML-based markup called XAML to describe the UI, like HTML does for a web page. WPF使用称为XAML的基于XML的标记来描述UI,就像HTML用于网页一样。 The XAML file is paired with a "code-behind" (.cs or .vb) file that is compiled together when the app is built. XAML文件与在构建应用程序时一起编译的“隐藏代码”(.cs或.vb)文件配对。 Adding an XML element to the XAML file is equvalient to declaring an object in the code-behind file. 在XAML文件中添加XML元素等同于在代码隐藏文件中声明一个对象。 For many classes, you can choose to do one or the other. 对于许多课程,您可以选择一个或另一个。

  2. 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). 使用可以使用C#或VB.NET语言编写Windows Phone应用程序(尽管App Hub上Windows Phone工具随附的免费Visual Studio Express中目前仅提供C#)。 Silverlight is a subset of the .NET Framework, whose classes can be used to write phone apps. Silverlight是.NET Framework的子集,其类可用于编写电话应用程序。 You can also use the XNA libraries to develop phone applications. 您也可以使用XNA库来开发电话应用程序。

I HIGHLY recommend Charles Petzolds free ebook for more. 我强烈推荐Charles Petzolds免费阅读更多电子书。 He does a great job of explaining this in the first couple chapters: http://charlespetzold.com/phone/index.html 他在前几章中做了出色的解释: http : //charlespetzold.com/phone/index.html

Hope that helps! 希望有帮助!

Win Forms are a light object oriented wrapper around the basic Win32 GDI primitives. Win Forms是围绕基本Win32 GDI原语的轻型面向对象包装。

WPF and Silverlight do their own rendering, don't use GDI and are built on XML-based layout and the MIL . WPF和Silverlight自己进行渲染,不使用GDI,它们基于XML布局和MIL构建。

Windows Phone Development uses Silverlight with C#. Windows Phone开发将Silverlight与C#结合使用。 The WP7 version of Silverlight runs on a modified version of Silverlight 3, which in itself uses a modified/minified .NET framework. Silverlight的WP7版本在Silverlight 3的修改版本上运行,Silverlight 3本身使用的是经过修改/缩小的.NET框架。 So WP7 development uses all of what you mentioned in question 2. 因此,WP7开发将使用您在问题2中提到的所有内容。

I can't give a much better answer than @jeffmaphone for question 1, so please look at his response. 对于问题1,我无法提供比@jeffmaphone更好的答案,因此请查看他的回答。

Windows Phone 7 uses Silverlight for the UI but the code can be C# or VB. Windows Phone 7将Silverlight用于UI,但是代码可以是C#或VB。 This page of Code Samples for Windows Phone has both but: Windows Phone代码示例页面具有以下两个功能:

In order to build and run Visual Basic samples, you must install additional developer tools. 为了生成和运行Visual Basic示例,您必须安装其他开发人员工具。 For more information, see Installing Windows Phone Developer Tools. 有关更多信息,请参阅安装Windows Phone Developer工具。

For more information see the Windows Phone 7 Developer Guide 有关更多信息,请参见Windows Phone 7开发人员指南。

1) Windows Forms is one method to develop GUI apps for Windows, WPF is another (for Vista, 7 and XP SP2). 1)Windows Forms是一种为Windows开发GUI应用程序的方法,WPF是另一种方法(对于Vista,7和XP SP2)。 In general, Windows Forms is great for simple, quick and dirty applications, while WPF works well for more complex and flashy applications. 通常,Windows窗体非常适合简单,快速和肮脏的应用程序,而WPF则适用于更复杂和浮华的应用程序。

2) Windows Phone uses Silverlight for non-game applications and XNA for games. 2)Windows Phone将Silverlight用于非游戏应用程序,将XNA用于游戏。 In both cases, you can use C# as the logic layer. 在这两种情况下,都可以使用C#作为逻辑层。 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. 换句话说,C#代码决定将内容放置在UI中的位置,而Silverlight或XNA是与显示器对话的不同方式。

Be careful about searching for Silverlight tutorials, because not all of Silverlight is on the phone. 在搜索Silverlight教程时要小心,因为并非所有的Silverlight都在手机上。

Here are my suggestions: 这是我的建议:

1) Check this discussion : WPF versus Winforms 1)检查此讨论: WPF与Winforms

2)Generally Windows Phone 7 supports two frameworks for developing applications– Silverlight and XNA. 2)通常,Windows Phone 7支持两个用于开发应用程序的框架-Silverlight和XNA。 Check MSDN for reference: 检查MSDN以供参考:

The Silverlight and XNA Frameworks for Windows Phone Windows Phone的Silverlight和XNA框架

Features Supported in Silverlight for Windows Phone Windows Phone的Silverlight支持的功能

PS: One of the best resource for Silverlight development is the official Silverlight web site: http://www.silverlight.net/ PS:Silverlight的最佳开发资源之一是Silverlight官方网站: http//www.silverlight.net/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM