什么是XAML,首先我们看下它的外观

<Window x:Class="Blend_WPF.WindowStyle"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Blend_WPF"  mc:Ignorable="d" >
    <Grid>
        <Button Content="Button" HorizontalAlignment="Left" Margin="271,203.5,0,0" VerticalAlignment="Top" Width="75"/>
    </Grid>
</Window>

外一层是Window,进一层是Grid,再进一层是Button,感觉是和Web静态网页一样的写法,除了前面多了一些自己暂时还看不懂的xmlns

其实并不是,XAML官方定义是:一种相对简单、通用的声明式编程语言。所以别看这标签是这样,其实一个个对象(经过XAML编译器和运行时解析器解释后)

比如上面的一个Button

<Button Content="Button" />

解开面纱,看本质

Button b=new Button();

b.Content="Button";

WPF通过XAML语言实现界面与逻辑分离,在一定程度上方便了开发人员和设计人员的分工协作,取得了不错的效果

最新文章

  1. Linux内核笔记--内存管理之用户态进程内存分配
  2. 全栈工程师学习Linux技术的忠告
  3. Android 测试工具
  4. c++ boost 汉字和模式串混用的例子
  5. Redis 五:配置主从复制功能
  6. Django Navi 重用
  7. Bind Enum to ListControl
  8. Adatper中获取宽高为0的问题
  9. java组装json和提取一个json的例子
  10. Roslyn and NRefactory
  11. 使用nio对磁盘下的文件进行过滤
  12. 反射实现java深度克隆
  13. CentOS6.5 上crontab每天自动备份mysql数据库
  14. ssh 登录报错 packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
  15. Linux中dpkg工具update-alternatives实现符号链接软件版本的切换(转)
  16. Fiddler基础用法-抓取浏览器数据包
  17. 最近开始研究php的缓存技术,来个系统自带的OPcache
  18. mybatis递归,一对多代码示例
  19. Xcode代码提示里的字母含义
  20. pytharm提示过期 License Activation 解决办法

热门文章

  1. allure用法(一)-配置信息及基本用法
  2. 2021年3月-第02阶段-前端基础-HTML+CSS阶段-Day03
  3. [译]ng指令中的compile与link函数解析 转
  4. Java数组-2022年4月17日
  5. XCTF练习题---MISC---Training-Stegano-1
  6. 一篇讲清楚String、StringBuffer和StringBuild
  7. 解决:Could not resolve dependencies for project xxx: Could not find artifact xxx
  8. learnByWork
  9. 国产开源优秀新一代MPP数据库StarRocks入门之旅-数仓新利器(上)
  10. 关于win10安装wsl子系统Ubuntu图形界面的错误解决