windows PHONE 开发-入门程序构筑
1:页面的扩展名为:.xaml文件类似于ASPX一样可以编写客户端显示内容和后台处理内容
一般的前台页面的形式为:
<Page
x:Class="MyFirstApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyFirstApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
<!-- 引用命名空间-->
xmlns:TabCtl="using:CustomControl"
<!-- 调用后台pageSizeChanged方法-->
SizeChanged="pageSizeChanged"
<!-- 设置页面背景颜色为白色-->
Background="White"> <!-- 上面工具栏-->
<Page.TopAppBar>
<AppBar x:Name="topBar" IsSticky="True" Style="{StaticResource TopBar}" Closed="ModeToolBar_Closed" Opened="topBar_Opened" >
<Grid x:Name="MenuGrid" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="71"/>
<ColumnDefinition MinWidth="615" Width="*" />
<ColumnDefinition Width="105>
</Grid.ColumnDefinitions>
<AppBarButton x:Name="tooltest1" Label="test1" Click="btntest_Click"></AppBarButton>
<AppBarButton x:Name="tooltest2" Grid.Column="2" Label="test2" IsEnabled="False"></AppBarButton>
</Grid>
</AppBar>
</Page.TopAppBar> <!-- 下面工具栏-->
<Page.BottomAppBar>
<AppBar x:Name="ModeToolBar" IsSticky="True" Style="{StaticResource BottomAppBar}" >
<Grid x:Name="EditGrid" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="53" />
<ColumnDefinition Width="105" />
</Grid.ColumnDefinitions>
<AppBarButton x:Name="tooltest3" Grid.Column="1" HorizontalAlignment="Center" Label="test3" ></AppBarButton>
<AppBarButton x:Name="tooltest4" Grid.Column="2" HorizontalAlignment="Center" Label="test4" ></AppBarButton>
</Grid>
</AppBar>
</Page.BottomAppBar>
</Page>
2:利用StaticResource引用样式的一般步骤
创建Styles文件夹,并在文件夹中创建Styles.xaml文件
删除Styles.xaml.cs文件
打开Styles.xaml文件,写入样式代码如下
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyFirstAppStyles">
<Style x:Key="TopBar" TargetType="AppBar">
<Setter Property="Height" Value="85"/>
<Setter Property="Background" Value="#CC222846"/>
</Style>
</ResourceDictionary>
在App.xaml配置关联文件
<Application
x:Class="MyFirstApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyFirstApp"> <!--关联Resources文件-->
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources> </Application>
windows PHONE 开发-入门程序构筑的更多相关文章
- Kinect for Windows SDK开发入门(一):开发环境配置
[译]Kinect for Windows SDK开发入门(一):开发环境配置 前几天无意中看到微软发布了Kinect for windows sensor,进去看了一下Kinect应用的例子,发现K ...
- Kinect for Windows SDK开发入门(15):进阶指引 下
Kinect for Windows SDK开发入门(十五):进阶指引 下 上一篇文章介绍了Kinect for Windows SDK进阶开发需要了解的一些内容,包括影像处理Coding4Fun K ...
- [MapReduce_add_1] Windows 下开发 MapReduce 程序部署到集群
0. 说明 Windows 下开发 MapReduce 程序部署到集群 1. 前提 在本地开发的时候保证 resource 中包含以下配置文件,从集群的配置文件中拷贝 在 resource 中新建 ...
- gcc和MinGW的异同(在cygwin/gcc做的东西可以无缝的用在linux下,没有任何问题,是在windows下开发linux程序的一个很好的选择)
cygwin/gcc和MinGW都是gcc在windows下的编译环境,但是它们有什么区别,在实际工作中如何选择这两种编译器. cygwin/gcc完全可以和在linux下的gcc化做等号,这个可以从 ...
- windows 驱动开发入门——驱动中的数据结构
最近在学习驱动编程方面的内容,在这将自己的一些心得分享出来,供大家参考,与大家共同进步,本人学习驱动主要是通过两本书--<独钓寒江 windows安全编程> 和 <windows驱动 ...
- Windows驱动开发入门指引
1. 前言 因工作上项目的需要,笔者需要做驱动相关的开发,之前并没有接触过相关的知识,折腾一段时间下来,功能如需实现了,也积累了一些经验和看法,所以在此做番总结. 对于驱动开发的开发指引,微软 ...
- [译]Kinect for Windows SDK开发入门(十八):Kinect Interaction交互控件
本文译自 http://dotneteers.net/blogs/vbandi/archive/2013/03/25/kinect-interactions-with-wpf-part-i-getti ...
- ESP-EYE V2.1 开发板 WINDOWS 10 开发入门
准备工作 1 × ESP-EYE V2.1 开发板 1 × Micro USB B 电缆 1 × PC(Windows10) 简介 ESP-EYE 是一款面向人脸识别和语音识别市场的开发板,搭载 ES ...
- Windows平台开发Mapreduce程序远程调用运行在Hadoop集群—Yarn调度引擎异常
共享原因:虽然用一篇博文写问题感觉有点奢侈,但是搜索百度,相关文章太少了,苦苦探寻日志才找到解决方案. 遇到问题:在windows平台上开发的mapreduce程序,运行迟迟没有结果. Mapredu ...
随机推荐
- c/c++ qsort 函数的简单使用(1)
#include <stdio.h> #include <stdlib.h> //打印数组元素 void print(int arr[], int n){ ; i < n ...
- FusionChart 数据的传入方式
已有案例,懒得写了,放个链接,大家看看吧.http://www.cnblogs.com/liujian21st/archive/2013/03/22/2975124.html
- 002-添加网站ico图标
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" me ...
- 2.1 C#的关键字
关键字是被C#规定了用途的重要单词.在visual studio中,关键字以蓝色字体显示.图中红色方框圈起来的就是关键字. 关键字 class ,这个关键字的用途是声明类.比如上面例子中,类名叫做Pr ...
- caffe学习笔记(一),ubuntu14.04+GPU (用Pascal VOC2007训练数据,并测试)
把源代码跑起来了,将实验过程记录如下,用于新手入门. 今天和师兄师姐才跑通,来分享下心得.(预训练网络:ImageNet_model,训练集:PASCAL VOC2007, GPU) 首先,整个tra ...
- AppCan开发者资料分享(定期更新)
开发者培训 上海20150925开发者培训资料:链接:http://pan.baidu.com/s/1mgCLzz6 密码:mqgi 版权声明:本文为博主原创文章,未经博主允许不得转载.
- http 协议集合,超级简单
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Web; ...
- FlasActionScript3随学随机
1.跳转页面代码.下载代码(new URLRequest(下载地址)): var request1:URLRequest=new URLRequest("http://www.baidu.c ...
- <hr> 的18种样式
18 Simple Styles for Horizontal Rules (hr CSS Design) Simple Styles for <hr>'s Code: <!DOCT ...
- android控件的对齐方式(转)
<?xml version="1.0" encoding="utf-8"?> <!-- android:layout_above 将该控件的底 ...