UWP入门(二) -- 基础笔记

简介: 原文:UWP入门(二) -- 基础笔记 不错的UWP入门视频,1092417123,欢迎交流 UWP-04 - What i XMAL? XAML - XML Syntax(语法) ,create instance of Classes that define the UI by setting properties(属性).
原文: 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:

    <Button Name="ClickMeButton"
            HorizontalAlignment="Left"
            Content="Click Me"
            Margin="20,20,0,0" 
            VerticalAlignment="Top" 
            Click="ClickMeButton_Click"
            Width="200"
            Height="100"
            >
        <Button.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black" Offset="0"/>
                <GradientStop Color="Red" Offset="1"/>
            </LinearGradientBrush>
        </Button.Background>
    </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);

<Grid Background="Black">
  <Grid.RowDefinitions>
    <RowDefinition Height="*" />//pertcentage,eg:android:layout_weight
    <RowDefinition Height="*" />
    <RowDefinition Height="*" />
  </Grid.RowDefinitions>
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
  </Grid.ColumnDefinitions>
</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:


  <Button Grid.Row="0" />
</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

<StackPanel>
  <TextBlock>Top</TextBlock>
  <TextBlock>Bottom</TextBlock>
</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.
目录
相关文章
|
4月前
|
定位技术 C# 图形学
从零开始的unity3d入门教程(二)----基本功能讲解
这是一篇Unity3D入门教程,详细介绍了Unity界面操作、游戏物体创建修改、场景搭建、玩家控制、音效添加以及游戏测试和导出的全过程。
从零开始的unity3d入门教程(二)----基本功能讲解
|
7月前
|
存储 Java Linux
产品入门第一讲:Axure的安装以及基本使用
产品入门第一讲:Axure的安装以及基本使用
|
7月前
|
IDE Java 应用服务中间件
第一章:入门、安装、配置
第一章:入门、安装、配置
|
安全 API 调度
Qt开发笔记:QGLWidget、QOpenGLWidget详解及区别
Qt开发笔记:QGLWidget、QOpenGLWidget详解及区别
Qt开发笔记:QGLWidget、QOpenGLWidget详解及区别
|
C# C++ 计算机视觉
Qt开发Activex笔记(一):环境搭建、基础开发流程和演示Demo
Qt开发Activex笔记(一):环境搭建、基础开发流程和演示Demo
Qt中文翻译(官方文档,界面,工具等)集锦
Qt中文翻译(官方文档,界面,工具等)集锦
734 0
UWP入门(一) -- 先写几个简单控件简单熟悉下(别看这个)
原文:UWP入门(一) -- 先写几个简单控件简单熟悉下(别看这个) 1. MainPage.xmal ...
1194 0
UWP开发入门(四)——自定义CommandBar
原文:UWP开发入门(四)——自定义CommandBar   各位好,再次回到UWP开发入门系列,刚回归可能有些不适应,所以今天我们讲个简单的,自定义CommandBar,说通俗点就是自定义类似AppBarButton的东西,然后扔到CommandBar中使用。
1306 0
|
Windows
UWP开发入门(一)——SplitView
原文:UWP开发入门(一)——SplitView   接下来会写一个UWP(Universal Windows Platform)开发入门的系列,自己学习到哪里,有什么心得总结,就会写到哪里。本篇对适用于顶层导航的SplitView控件展开讨论。
1630 0