于XAML导入命名空间的代码
2015-10-14 12:51
211 查看
例如,下面的代码到指定的命名空间。不仅导入的命名空间,并且还为指定的命名空间前缀local。当然,你也可以指定一个前缀为另一个名称,这可以定义。导入后,市民可以在命名当前空间XAML使用代码。例如,在演示样品TimeButton这个类,事实上,它是从继承button控件类。
<Window x:Class="Demo002.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Demo002" Title="MainWindow" Height="350" Width="525"> <Grid x:Name="Grid1"> <Grid x:Name="Grid2"> <Grid x:Name="Grid3"> <StackPanel x:Name="StackPanel1"> <ListBox x:Name="ListBox1" /> <local:TimeButton x:Name="TimeButton1" Width="80" Height="80" Content="Report Time" /> </StackPanel> </Grid> </Grid> </Grid> </Window>
相关文章推荐
- Java Cookbook-Date and Times
- C++取a到b之间的随机数
- 重学C++Primer笔记10---容器常用用法总结与归纳
- java.util.ConcurrentModificationException的异常的出现与解决
- Java Mail:Session、Message详解
- c++指针
- C++的四种操作符:static_cast,dynamic_cast,reinpreter_cast,const_cast
- (改)编程实验一 词法分析程序
- 检查c#代码内存泄露工具-CLR Profiler
- python中的常用函数
- [成也Java,败也Java]之[败也Java]
- Spring-----1、Spring一个简短的引论
- java使用jxl导出excel字符串类型转化成数值型
- thinkPHP 多个数据库 切换
- java使用jxl导出excel字符串类型转化成数值型
- 使用 ssh key 验证 github
- java仿qq登陆界面
- Java基础知识强化之IO流笔记69:Properties练习之 判断文件中是否有指定的键,如果有就修改值的案例
- 【springmvc+mybatis项目实战】杰信商贸-35.业务出口报运WebService2
- python to be Windows Daemon