在 XAML 中嵌入脚本语言代码?
如何在 XAML 定义中嵌入 Lua 脚本或 IronPython/IronRuby 脚本?
How to embed a Lua script or IronPython/IronRuby script within the XAML definition?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看http://www.thinkbottomup.com.au/site/blog/Embedding_DLR_Scripts_in_XAML_Part_1 有关执行此操作的非常好的教程。他的示例中唯一的缺点是他定义路由事件处理程序的方式仅允许您定义要处理的单个事件,但很容易对其进行修改以定义事件集合。恕我直言,这是将 UI 行为转移到视图中的好方法,但我可能会因为这样说而受到纯粹主义者的猛烈抨击。
Check out http://www.thinkbottomup.com.au/site/blog/Embedding_DLR_Scripts_in_XAML_Part_1 for a really good tutorial on doing this. The only shortcoming in his example is the way he defined the routed event handler only allows you to define a single event to be handled but it was easy to modify it to define a collection of events instead. IMHO this is a great way to move UI behavior into the view but I'll probably be slammed by the purists for saying it.