在Silverlight中将动态按钮引用到staticresource [英] Reference dynamic button to staticresource in silverlight

查看:58
本文介绍了在Silverlight中将动态按钮引用到staticresource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WPF中,您可以找到资源来查找静态资源,如下所示:

按钮b =  Button();
b.Style =(Style)FindResource(" ); 



我正在WP7/Silverlight中尝试执行相同的操作,但是FindResource不可用.有没有办法将我动态创建的按钮引用到staticresource?请帮忙.

在此先谢谢您! -style-more-then-once-in-silverlight-20-application/> http://khason.net/blog/findresource-replacement-and-to-to-to-to-to-to-to-to-to-to-change-control-style-more-then-once -in-silverlight-20-application/ [Button b = new Button(); b.Style = (Style)FindResource("CustomButton");



I''m trying to do the same in WP7/Silverlight but FindResource is unavailable. Is there a way to reference the button that I created dynamically to a staticresource? Please help.

Thanks in advance!

See http://khason.net/blog/findresource-replacement-and-how-to-change-control-style-more-then-once-in-silverlight-20-application/[^]

BTW you would have hit upon that blog within the first page of a reasonably well-worded google search.


这篇关于在Silverlight中将动态按钮引用到staticresource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆