简体   繁体   English

初学者的一些Silverlight和Windows Phone通用问题

[英]Some Silverlight and Windows Phone generic questions of a beginner

I'm starting developing Windows Phone applications and even having a somewhat strong background in WPF is my first time with Silverlight. 我开始开发Windows Phone应用程序,甚至在WPF中拥有一定的背景知识也是我第一次使用Silverlight。 There are some things that I don't understand yet: 有些事情我还不了解:

  1. Is Silverlight a whole executing engine? Silverlight是整个执行引擎吗? Replaces the .NET engine? 取代.NET引擎? Or is it a set of Assemblies? 还是一组程序集?
  2. Are Silverlight and .NET assemblies different? Silverlight和.NET程序集是否不同? Are they compatible? 它们兼容吗?
  3. Why a Winows Phone 8 Project in Visual Studio 2012 shows 3 references but when you look at the csproj there is only a reference to Microsoft.Phone.Controls.dll? 为什么Visual Studio 2012中的Winows Phone 8项目显示3个引用,但是当您查看csproj时,只有Microsoft.Phone.Controls.dll的引用?

About the point 3, an screenshot to make it more clear: 关于第3点,请使用屏幕截图以使其更加清晰:

在此处输入图片说明

These 3 references are creared with the following csproj line: 以下csproj行会破坏这3个引用:

<Reference Include="Microsoft.Phone.Controls, Version=8.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e, processorArchitecture=MSIL" />
  1. Somewhat simplified you can think of Silverlight as a subset of the full (desktop) .NET framework. 可以稍微简化一下,您可以将Silverlight视为完整(桌面).NET框架的子集。 More to the point, .NET as available on Windows Phone 8 supports a subset of the "traditional" .NET capabilities. 更重要的是,Windows Phone 8上可用的.NET支持“传统” .NET功能的子集。 From a WPF perspective you'll notice that there is no support for commands as you would use them in a desktop application for instance, there are also many other smaller differences. 从WPF的角度来看,您会发现不支持命令,例如在桌面应用程序中会使用它们,还有许多其他小的区别。
  2. Yes, Silverlight and desktop .NET assemblies are different. 是的,Silverlight和桌面.NET程序集是不同的。 While many classes are pretty much identical in the two environments, the actual assemblies are different. 尽管两种环境中的许多类几乎相同,但实际的程序集却不同。 You can't for instance take an assembly built using the desktop .NET framework and directly use it on Windows Phone (although if you have the source code it's possible that you can build the source into a Windows Phone assembly) 例如,您不能将使用桌面.NET框架构建的程序集直接在Windows Phone上使用(尽管如果您有源代码,则可以将源代码构建到Windows Phone程序集中)
  3. Not sure what the question is here. 不知道这里有什么问题。 I typically just see the reference to Windows Phone as the standard framework assembly in my projects (plus, of course, any other assemblies I choose to reference) 我通常只是在项目中将对Windows Phone的引用视为标准框架程序集(当然,还有我选择引用的任何其他程序集)

If you're looking at sharing code across .NET platforms (eg Desktop, Phone, Win8/RT), you'll want to take a look at Portable Class Libraries . 如果您正在考虑跨.NET平台(例如,台式机,电话,Win8 / RT)共享代码,则需要了解可移植类库 These effectively target a common subset of .NET functionality that can run on all supported platforms. 这些有效地针对可在所有受支持平台上运行的.NET功能的公共子集。 It's a handy way of sharing code between Windows Phone and Windows 8 apps for instance. 例如,这是在Windows Phone和Windows 8应用程序之间共享代码的便捷方法。

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

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