银光与视觉树操作
现在这可能带来的麻烦多于它的价值,但尽管如此,它现在对我来说确实很有用。
我想知道的是如何在运行时操作 Silverlight 可视化树。做一些简单的事情(例如添加和删除控件)很容易,但是当您开始必须以合理的复杂程度遍历树时,我发现自己渴望使用 JQuery 样式语法(我认为 LINQ 也很酷)来处理 DOM 节点替换、动作等。
所以我想问题是是否有任何库可以使这项工作变得更容易,或者是否有一些我错过的东西?
Now this may be more trouble than it's worth but nevertheless, it'd be really useful to me right now.
What I'd like to know is how I might go about manipulating the Silverlight visual tree at runtime. Doing simple things like adding and removing controls is easy enough but when you start having to traverse the tree with any reasonable amount of complexity I find myself yearning for a JQuery style syntax (LINQ would be pretty cool too I suppose) to handle DOM node replacements, movements and the like.
So I guess the question is are there any libraries out there to make this an easier job or is there something baked in that I've missed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,Linq 扩展方法正是您所追求的,但您需要首先放置一个小型基础设施:-
现在您可以使用 Linq 来查询可视化树。一些例子:-
Yes Linq extension methods are what you are after but you need to put inplace a litte infrastructure first:-
Now you can use Linq to query into the visual tree using Linq. Some examples:-
您可能对此LINQ to Visual Tree感兴趣实施。
You might be interested in this LINQ to Visual Tree implementation.
这是什么版本的 silverlight?
这篇文章是哪一年的“12 月 13 日 13:13”?
在当前版本的 SL4 中似乎不存在..
what version of silverlight is this?
And what year of " Dec 13 at 13:13" is this post from?
in the current version of SL4 it does not seem to be there..
我使用此代码从可视化树中获取控件
I use this code to get controls from the visual tree