原文:UWP入门(二) -- 基础笔记

不错的UWP入门视频,1092417123,欢迎交流

UWP-04 - What i XMAL?

XAML - XML Syntax(语法) ,create instance of Classes that define the UI by setting properties(属性).

UWP-05 - Understanding Type Converters

Type Converters - Convert literal(字面的) strings in XML into enumerations,instance of classes,etc

UWP-06 - Understanding Default Properties, Complex Properties and the Property Element Syntax

Default Property … Ex. setrs Content Property:Click Me(this property is Content)

Complex Properties - Break out a property into its own element syntax:

  1. <Button Name="ClickMeButton"
  2. HorizontalAlignment="Left"
  3. Content="Click Me"
  4. Margin="20,20,0,0"
  5. VerticalAlignment="Top"
  6. Click="ClickMeButton_Click"
  7. Width="200"
  8. Height="100"
  9. >
  10. <Button.Background>
  11. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  12. <GradientStop Color="Black" Offset="0"/>
  13. <GradientStop Color="Red" Offset="1"/>
  14. </LinearGradientBrush>
  15. </Button.Background>
  16. </Button>

UWP-07 - Understanding XAML Schemas and Namespace Declarations

Schema stuff(语法约束,最上面那一块),is part of XAML,the number is 6.

Schemas define rules for XAML,for UWP,for desinger support,etc.

Namespaces tell XML parser where to find the definition/rules for a given element in the XAML.

UWP-08 - XAML Layout with Grids

Layout controls don’t have a content property …

they hava a Children property of type UIElementCollection.

By embedding any control inside of a layout control,

you are implicitly calling the Add method of the Children collection property.

eg:Grid.Children.Add(MyButton);

  1. <Grid Background="Black">
  2. <Grid.RowDefinitions>
  3. <RowDefinition Height="*" />//pertcentage,eg:android:layout_weight
  4. <RowDefinition Height="*" />
  5. <RowDefinition Height="*" />
  6. </Grid.RowDefinitions>
  7. <Grid.ColumnDefinitions>
  8. <ColumnDefinition Width="*" />
  9. <ColumnDefinition Width="*" />
  10. <ColumnDefinition Width="*" />
  11. </Grid.ColumnDefinitions>
  12. </Grid>

Sizes expressed in terms of:

Explicit pixels - 100//use pixels

Auto - use the largest value of elements it contains to define the width / height

* (Star Sizing) - Utilize all the available space

1* - Of all available space, give me 1 “share”

2* - Of all available space, give me 2 “shares”

3* - Of all available space, give me 3 “shares”

6 total shares … 3* would be 50% of the available width / height.

Elements put themselves into rows and columns using attached property syntax:



  1. <Button Grid.Row="0" />
  2. </Grid>
  • When referencing Rows and Columns … 0-based.
  • There’s always one default implicit cell: Row 0, Column 0
  • If not specified, element will be in the default cell

UWP-09 - XAML Layout with StackPanel

  1. <StackPanel>
  2. <TextBlock>Top</TextBlock>
  3. <TextBlock>Bottom</TextBlock>
  4. </StackPanel>
  • Vertical Orientation by default.
  • Left-to-right flow by default when Horizontal orientation.
  • Most layouts will combine multiple layout controls.
  • Grid will overlap controls. StackPanel will stack them.

UWP入门(二) -- 基础笔记的更多相关文章

  1. git 入门二 (基础)

     1.创建新仓库      git init    touch  test.txt  git add --a  git commit -m "fist commit"    初始化 ...

  2. C#线程学习笔记九:async & await入门二

    一.异步方法返回类型 只能返回3种类型(void.Task和Task<T>). 1.1.void返回类型:调用方法执行异步方法,但又不需要做进一步的交互. class Program { ...

  3. CG基础教程-陈惟老师十二讲笔记

    转自 麽洋TinyOcean:http://www.douban.com/people/Tinyocean/notes?start=50&type=note 因为看了陈惟十二讲视频没有课件,边 ...

  4. JavaScript基础笔记二

    一.函数返回值1.什么是函数返回值    函数的执行结果2. 可以没有return // 没有return或者return后面为空则会返回undefined3.一个函数应该只返回一种类型的值 二.可变 ...

  5. Swift语法基础入门二(数组, 字典, 字符串)

    Swift语法基础入门二(数组, 字典, 字符串) 数组(有序数据的集) *格式 : [] / Int / Array() let 不可变数组 var 可变数组 注意: 不需要改变集合的时候创建不可变 ...

  6. Qt入门之基础篇 ( 二 ) :Qt项目建立、编译、运行和发布过程解析

    转载请注明出处:CN_Simo. 题解: 本篇内容主讲Qt应用从创建到发布的整个过程,旨在帮助读者能够快速走进Qt的世界. 本来计划是讲解Qt源码静态编译,如此的话读者可能并不能清楚地知道为何要静态编 ...

  7. IM开发者的零基础通信技术入门(二):通信交换技术的百年发展史(下)

    1.系列文章引言 1.1 适合谁来阅读? 本系列文章尽量使用最浅显易懂的文字.图片来组织内容,力求通信技术零基础的人群也能看懂.但个人建议,至少稍微了解过网络通信方面的知识后再看,会更有收获.如果您大 ...

  8. 2.Python爬虫入门二之爬虫基础了解

    1.什么是爬虫 爬虫,即网络爬虫,大家可以理解为在网络上爬行的一直蜘蛛,互联网就比作一张大网,而爬虫便是在这张网上爬来爬去的蜘蛛咯,如果它遇到资源,那么它就会抓取下来.想抓取什么?这个由你来控制它咯. ...

  9. Python爬虫入门二之爬虫基础了解

    1.什么是爬虫 爬虫,即网络爬虫,大家可以理解为在网络上爬行的一直蜘蛛,互联网就比作一张大网,而爬虫便是在这张网上爬来爬去的蜘蛛咯,如果它遇到资源,那么它就会抓取下来.想抓取什么?这个由你来控制它咯. ...

随机推荐

  1. 学习算法 - 表指针实现~ C++

    表指针实现.第二种方法是使用访问列表,模拟指针. 在我的理解中学习,它是创建一个节点数组,模拟存储装置,然后从中分配内存和释放内存. 但实际的内存没有被释放~ 下面的代码直接附着: // // mai ...

  2. error: invalid abbreviation code [25] for DIE at 0x0000003e in Assertion failed: (*offset_ptr == end_prologue_offset), function ParsePrologue, file /S

    error: invalid abbreviation code [25] for DIE at 0x0000003e in '/Users/mac/Desktop/MYiosfiles/test/X ...

  3. fatal error: expat.h: No such file or directory

    在CentOS7最小安装版下,编译安装apr-util时报错: fatal error: expat.h: No such file or directory 解决办法:yum install exp ...

  4. 两分钟读懂ThreadLocal

    ThreadLocal的工作原理 场景 假设一个用户是一个线程.他们都对数据库进行操作,这个时候就会每个用户就会从数据源中开启一个事务以确保能够顺利的打开或者关闭事务.那么如何保证用户与用户之间的数据 ...

  5. HTML:描述语义

    一.HTML HTML:Hypertext Markup Launguage,超文本标记语言,是网页的就文件格式,用于描述网页语义. 二.HTML骨架 DTD手册:http://www.w3schoo ...

  6. JavaScript取出字符串和尾随空格

    书写JavaScript性能trim()之前和之后删除空字符串格,的功能的应用String物replace()方法去除空字符串端到端格.trim()例如,对于功能键下面的代码: <script ...

  7. Java 中override、overload、overwrite区别,以及与多态的关系【转】

    因为早期的翻译导致了override和overwrite的解释及理解混乱,需要重新梳理这几个词及相关内容. 转自:http://blog.csdn.net/lzhang007/article/deta ...

  8. WPF MVVM模式中,通过命令实现窗体拖动、跳转以及显隐控制

    原文:WPF MVVM模式中,通过命令实现窗体拖动.跳转以及显隐控制 在WPF中使用MVVM模式,可以让我们的程序实现界面与功能的分离,方便开发,易于维护.但是,很多初学者会在使用MVVM的过程中遇到 ...

  9. Ubuntu logomaker sh: 1: pngtopnm: not found 解决方案

    暂时未找到logomaker的方法,来解决 命令替换,在文件夹: pngtopnm open_show.png > temp.ppm ppmquant 224 temp.ppm >temp ...

  10. WPF内实现与串口发送数据和接收数据

    原文:WPF内实现与串口发送数据和接收数据 与串口发送数据和接收数据,在此作一个简单的Demo.此Demo可以实现按下硬件按钮,灯亮,发送灯状态数据过来.并且可以实现几个灯同时亮,发送灯的状态数据过来 ...