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 the开发者_C百科ir 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?
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.
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
精彩评论