Silverlight中如何在cs文件中写ControlTemplate 在Silverlight中在XAML文件中很好定义ControlTemplate,但是在cs文件中就不是很容易,有一种方法是通过XamlReader可以来load出ControlTemplate,那么有没有使用new来写ControlTemplate的,就是ControlTemplate里面的东西都是通过实例化类来实现的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 比较麻烦的。参考这个例子: public Window1() { InitializeComponent(); ControlTemplate template = new ControlTemplate(); template.VisualTree = new FrameworkElementFactory(typeof(TextBox)); this.Template = template; } 三楼的是wpf中的吧?Silverlight中可以做到吗?Silverlight的ControlTemplate 是没有VisualTree 属性的,还有其它的吗,谢谢 这样的话就没有办法了。即使在WPF里,FrameworkElementFactory也是deprecated的。推荐动态生成XAML ControlTemplate 做了一个string 拼接的的,但是人家说不想使用string,就像new出来创建,唉,这世道 呵呵 wince 编写时钟代码 秒针不准问题 C# 怎么实现把SQL2005中的数据导出到Access中 ZedGraph 曲线图问题 关于接口变量的问题 用command添加参数更新sql数据库时,用的sql语句可不可以包含子查询?急!! 再次请教各位一个问题 关于文字链接的一个问题!大侠们都来看看啊! 有关程序集动态加载的问题 如何将 .NET 程序迁移到 Crystal Report 9.2……(更新:2003-10-15,作者:海波.NET) 那个FTP202.108.202.26下载的VS。NET文件要密码,那位朋友帮帮忙?(lxg119) 这段代码的结果 KeyDown事件问题
参考这个例子:
public Window1()
{
InitializeComponent(); ControlTemplate template = new ControlTemplate();
template.VisualTree = new FrameworkElementFactory(typeof(TextBox));
this.Template = template;
}
推荐动态生成XAML