为什么 Silverlight 4 中不鼓励使用触发器?

发布于 2024-09-26 01:07:11 字数 467 浏览 1 评论 0原文

Silverlight 的 MSDN 文档现在在多个地方进行了说明:

整个触发器语法在 Silverlight 4 中是一种不鼓励的技术。 [12]

不过,Expression Blend 似乎很乐意支持和鼓励它们的使用,并且有很多博客文章赞扬了触发器和操作的使用,没有任何警告。

推荐的触发器替代品是什么?我应该坚持使用代码隐藏事件处理程序吗?

The MSDN documentation for Silverlight now states in several places:

The entire Triggers syntax is a discouraged technique in Silverlight 4. [1, 2]

Expression Blend seems to happily support and encourage their use, though, and there are plenty of blog posts extolling the use of Triggers and Actions without any caveats.

What is the recommended replacement for triggers? Should I stick to code-behind event handlers?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

飞烟轻若梦 2024-10-03 01:07:11

你会混淆两个不同的触发器。您指向的MSDN文档是Silverlight SDK System.Windows触发器,除了支持Loaded事件之外什么也做不了。

您在博客文章中看到的大量触发器和操作都引用了 Blend SDK,它们具有更广泛的范围并且非常有用。

Your get mixed up between two different Triggers. The MSDN documentation you point to are Silverlight SDK System.Windows triggers that apart from supporting the Loaded event can do nothing else.

The plethora of Triggers and Actions you are seeing in blog posts refer the Blend SDK which have a much wider scope and are very useful.

明天过后 2024-10-03 01:07:11

在 Silverlight 中,他们引入了 VisualStateManager,这被视为实现触发器通常用途的更简洁的方法。它很受欢迎并且(我认为)此后已被添加到 WPF 中。

Tim Heuer 的博客对使用 VSM 有相当好的介绍:

http://timheuer.com/blog/archive/2008/06/04/silverlight-introduces-visual-state-manager-vsm.aspx

In Silverlight they introduced the VisualStateManager which is seen as a cleaner way of achieving what Triggers are normally used for. It was well received and (I think) has since been added to WPF.

Tim Heuer's blog has a fairly good introduction to using the VSM:

http://timheuer.com/blog/archive/2008/06/04/silverlight-introduces-visual-state-manager-vsm.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文