1.2 步入WPF

下面是WPF的一些亮点:

广泛整合:各种媒体类型都能组合起来并一起呈现

与分辨率无关:因为WPF使用矢量图形

硬件加速:WPF是基于Direct3D创建的,工作全部是由GPU完成的

声明式编程

富创作和定制

易于部署

 

2.1 XAML 定义

XAML是一种相对简单、通用的声明式编程语言

XAML由一些规则(告诉解析器和编译器如何处理XML)和一些关键字组成

2.2 元素和特性

2.3 命名空间

XML命名空间

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 http://schemas.microsoft.com/winfx/2006/xaml/presentation 相当于.NET命名空间 System.Windows  System.Windows.Controls 等

 

2.4属性元素

<Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             Content="OK" >
</Button>

等价于

<Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
       <Button.Content> OK </Button.Content>
</Button>

2.5 类型转换器

 

相关文章:

  • 2021-12-12
  • 2021-10-09
  • 2021-12-21
  • 2021-05-13
  • 2021-09-28
  • 2021-12-13
  • 2022-03-10
  • 2021-05-12
猜你喜欢
  • 2021-05-16
  • 2021-11-07
  • 2021-10-30
  • 2021-08-23
  • 2021-10-13
  • 2021-12-06
  • 2022-01-21
相关资源
相似解决方案