zoukankan      html  css  js  c++  java
  • [wpf笔记] 1.xaml

          快到年终了,断断续续学习wpf也三四个月了,感觉技术还是没有成长,昨天被鄙视技术,好好的反思了一下,决定从头再复习,要在意小的细节。

    现在开始一边学,一边写。最后以一个项目结束,争取年前搞定。

    本篇在意的是实现,概念的什么都不讲了。

    1.学习前的注意

          在xaml中,所有的标签都映射为.net类的实例。标签名对应类名,比如<Button> 就是创建一个Button对象。

       开始标签与结束标签的对应<Button></Button>

          通过特性设置可以来设置每个类的属性<Button Width="200" Height="100"></Button>

      每个文档包含一个顶级标签<Window>,代表整个窗口。

    2.xaml名称空间

    <Window x:Class="WpfApplication1.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            
        </Grid>
    </Window>
    

     x:Class表示创建出一个实例类,在后台代码中后有一个与之对应的类存在。

     xmlns用来声明命名空间

    3.命名元素

      设置元素x:Name,可以在后台代码中进行访问

  • 相关阅读:
    73. Set Matrix Zeroes
    289. Game of Live
    212. Word Search II
    79. Word Search
    142. Linked List Cycle II
    141. Linked List Cycle
    287. Find the Duplicate Number
    260. Single Number III
    137. Single Number II
    Oracle EBS中有关Form的触发器的执行顺序
  • 原文地址:https://www.cnblogs.com/wuyuetian/p/4158707.html
Copyright © 2011-2022 走看看