学习wp开发第一次总结
2013-06-08 22:28
176 查看
今天看了下wp开发书,顺便总结一下。
首先说下MainPage.xaml的页面结构。
View Code
所有xaml代码都放在<phone:PhoneApplicationPage>里面,从上到下看,
x:Class这个是页面继承的类,也就是对应的隐藏代码里面的类。
xmlns这是默认的命名空间,如果页面控件没有前缀,那么代表它就是属于默认的命名空间。
xamlns:x这是代表专属空间,比如空间里面Name属性那么x:Name就是代表这个xaml的名字空间。
xmlns:phone这个是包含在wp的引用dll,
xmlns:shell包含在miscroft.shell里面的dll文件,可以帮助管理生命周期。
xmlns:d这是设计时的数据,而真正运行起来时会帮我们忽略掉这些运行时的数据。
xmlns:mc这是布局兼容性,主要配合xmlns:d使用。它包含Ignorable属性,可以在运行时忽略掉这些设计时的数据。
所有页面内容都全部放在layoutRoot的grid中。
App.xaml这个文件是程序的全局文件。里面可以放一些全局资源和应用程序的全局事件详细看书20-21页。
WMAppMainifest.xml文件主要是设置程序图标,可以使用的功能,和支持的分辨率等。
AppManifest.xml文件是生成应用程序所必须的应用程序清单文件。
AssmblyInfo.cs做过winform的人都知道,不必解释。
首先说下MainPage.xaml的页面结构。
<phone:PhoneApplicationPage x:Class="HelloWorld.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" shell:SystemTray.IsVisible="True"> <!--LayoutRoot 是包含所有页面内容的根网格--> <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!--TitlePanel 包含应用程序的名称和页标题--> <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> <TextBlock Text="我的应用程序" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/> <TextBlock Text="页面名称" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> </StackPanel> <!--ContentPanel - 在此处放置其他内容--> <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <Button Content="Button" HorizontalAlignment="Left" Margin="154,190,0,0" VerticalAlignment="Top" RenderTransformOrigin="-2.143,0.741" Click="Button_Click"/> </Grid> </Grid> </phone:PhoneApplicationPage>
View Code
所有xaml代码都放在<phone:PhoneApplicationPage>里面,从上到下看,
x:Class这个是页面继承的类,也就是对应的隐藏代码里面的类。
xmlns这是默认的命名空间,如果页面控件没有前缀,那么代表它就是属于默认的命名空间。
xamlns:x这是代表专属空间,比如空间里面Name属性那么x:Name就是代表这个xaml的名字空间。
xmlns:phone这个是包含在wp的引用dll,
xmlns:shell包含在miscroft.shell里面的dll文件,可以帮助管理生命周期。
xmlns:d这是设计时的数据,而真正运行起来时会帮我们忽略掉这些运行时的数据。
xmlns:mc这是布局兼容性,主要配合xmlns:d使用。它包含Ignorable属性,可以在运行时忽略掉这些设计时的数据。
所有页面内容都全部放在layoutRoot的grid中。
App.xaml这个文件是程序的全局文件。里面可以放一些全局资源和应用程序的全局事件详细看书20-21页。
WMAppMainifest.xml文件主要是设置程序图标,可以使用的功能,和支持的分辨率等。
AppManifest.xml文件是生成应用程序所必须的应用程序清单文件。
AssmblyInfo.cs做过winform的人都知道,不必解释。
相关文章推荐
- Eclipse插件开发---学习总结
- iOS每日总结博客版:iOS开发历程中了解和学习的文章
- ABAP学习开发总结之二:ABAP编辑器了解
- java学习笔记1--java开发环境平台总结
- WebService学习总结(三)——使用JDK开发WebService
- 微信开发学习总结(三)——access_token管理
- iOS开发学习总结——数据存储和参数传递
- 【IOS 开发学习总结-OC-5】objective-c 的流程控制
- 【IOS 开发学习总结-OC-45】★★ios开发之UI控件——UISegmentedControl与UIImageView
- HTML5学习总结-01 开发环境和历史
- [0day安全-学习总结]第三章开发shellcode的艺术之shellocde编码解码原理
- 设计模式游戏完美开发的学习总结
- Kafka学习总结(六)——应用开发
- 学习敏捷开发(trello)之party_bid卡片1总结
- 新人学习Android开发遇到的小问题总结
- Linux内核与驱动开发学习总结:原子操作实现(六)
- Android基于XMPP Smack Openfire下学习开发IM(六)总结
- 敏捷开发系列学习总结(7)——敏捷开发的10大指导原则