Gets the collection of triggers established directly on this element, or in child elements.
Assembly: PresentationFramework (in PresentationFramework.dll)
This property can only be set in Extensible Application Markup Language (XAML) through the collection syntax shown, or by accessing the collection object and using its various methods such as Add. The property to access the collection object itself is read-only, the collection itself is read-write. The property only exists on root elements; attempting to find it or set it elsewhere will cause an exception to be thrown.
This property does not enable you to examine triggers that exist as part of styles in use on this element. It only reports the collection of triggers that are literally added to the collection, either in markup or code. Elements do not typically have such elements existing by default (through a template for instance); it is more common for triggers that come from control compositing to be established in styles instead.
In terms of behavior (and trying to establish which effect came from which element's declared Loaded to get this collection, the child element's triggers might not yet be fully loaded, and the collection will be smaller than it would truly be at run time.collection), both the triggering condition and the trigger effect might be on this element, or might be on its child elements in the logical tree. Note that if you use lifetime events such as
Note that the collection of triggers established on an element only supports EventTrigger, not property triggers (Trigger). If you require property triggers, you must place these within a style or template and then assign that style or template to the element either directly through the Style property, or indirectly through an implicit style reference.
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0