代码改变世界

wp学习笔记(1)

2010-05-13 22:04  Aga.J  阅读(370)  评论(0编辑  收藏  举报

  最近好多事情忙,而且因为电脑的内存只有1G,所以连模拟器也启动不了,所以暂时放下了windows phone的学习,回来一看,才知道原来部分网站上已经贴出了其他新的东西,哎呀,现在赶紧从头开始学吧

新建了silverlight工程后出现下面的文件

1 App.xaml / App.xaml.cs

为程序定义了入口点,初始化了程序内所需要的资源,展示了程序的用户接口

2 MainPage.xaml / MainPage.xaml.cs

定义了一个带有用户界面的程序的页面

3 ApplicationIcon.png

一个icon的图像文件,这个文件表示程序在phone的应用程序列里的程序图标

4 Background.png

一个icon的图像文件,表示在start screen里对应的图标

5 Properties\AppManifest.xml

生成程序包所需要的说明文件

6 Properties\AssemblyInfo.cs

包含了已经嵌入到已生成的集合的名字和版本数据

7 Properties\WMAppManifest.xml

一个包括与windows phone silverlight有关的数据的详细说明文件,其中包括只能在windows phone上使用的silverlight的详细特征

8 References folder

提供给程序所需的服务和功能的集合或者库

打开App.xaml可以看到在Application.Resources标签下已经定义了很多属性,包括colors,brushes等等

不翻译了。。。。没什么时间。。。

The App.xaml file, together with its code-behind file App.xaml.cs, defines an instance of the Application class. This class encapsulates a Silverlight for Windows Phone application and provides its entry point. It also contains application-level resources such as colors, brushes and style objects used throughout the application. You can completely update the visual appearance of the application by changing the definitions contained in this file, much like CSS style sheets control the appearance of HTML pages.
The RootVisual property in the Application class identifies the starting page of the application. All Windows Phone applications have a single top-level container element whose data type is PhoneApplicationFrame. The frame hosts one or more PhoneApplicationPage elements that present content for the application. It also handles navigation between pages.

Extensible Application Markup Language (XAML) is a declarative language. You can create visible UI elements in the declarative XAML markup. You can then use a separate code-behind file to respond to events and manipulate the objects you declared in XAML. An XAML-based declarative language is very intuitive for creating interfaces from prototype to production, especially for people with a background in Web design and technologies.

A Grid is a layout element that acts as a container for other controls. Its main purpose is to position and arrange its child controls. Several layout controls exist to provide alternative layout behaviors:
Canvas: Defines an area within which you can explicitly position child elements by coordinates relative to the Canvas area.
Grid: Defines a flexible grid area consisting of columns and rows.
StackPanel: Arranges child elements into a single line that can be oriented horizontally or vertically.
For more information, see Silverlight Layout System.