(WPF)XAML 过程式代码
2015-07-27 07:34
197 查看
当代码编译,x:Code 元素的内容将被放到.g.cs文件。
<Window x:Class="WpfApplication7.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>
<Button Background="{x:Null}"
Height="32"
x:Name="Btn"
Click="Btn_Click"
Width="{x:Static SystemParameters.IconWidth}"
Content="{Binding Path=Width,RelativeSource={RelativeSource Self}}"
>
</Button>
<x:Code>
<![CDATA[
void Btn_Click(object sender,RoutedEventArgs e)
{
this.Close();
}
]]>
</x:Code>
</Grid>
</Window>
<Window x:Class="WpfApplication7.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>
<Button Background="{x:Null}"
Height="32"
x:Name="Btn"
Click="Btn_Click"
Width="{x:Static SystemParameters.IconWidth}"
Content="{Binding Path=Width,RelativeSource={RelativeSource Self}}"
>
</Button>
<x:Code>
<![CDATA[
void Btn_Click(object sender,RoutedEventArgs e)
{
this.Close();
}
]]>
</x:Code>
</Grid>
</Window>
相关文章推荐
- 【java】itoo项目实战之hibernate 批量保存优化
- Delphi 2009 泛型容器单元(Generics.Collections)[4]: TDictionary<T>
- Python - 命令行参数
- item-based algorithm
- Java学习笔记-------数据库疑问
- 【python】hust virtual judge 交题记录抓取
- java写入文件的几种方法分享
- JavaSE初学笔记之<并发编程—内存模型、可见性、原子性>
- Ubuntu 中 java 环境 (sunjdk) 的配置 (附详细说明)
- 在matlab中进行遥感影像地理坐标的相互转换
- 三种初步简易的方法求解数值问题 of C++
- java多线程(继承Thread以及实现Runnable接口)
- 《C++编程思想》第二章 数 据 抽 象(原书代码+习题+答案)
- 读书笔记MoreEffectiveC++(12)
- 获取分享社最新一期的迅雷分享账号
- Evaluate Reverse Polish Notation
- JAVA笔记之函数
- Lua打印table
- as3.0 矩形边框的颜色渐变代码实现
- c++ 字符反转函数