A possibility to describe declaratively a user interface
based on XAML has become the reason to think about the building of the user
interfaces in a different way. This approach has allowed distribution work
between a programmer and designer. It has defined a new branch of a user
interfaces development industry.
As is known, user interfaces are based on the set of
templates (ControlTemplate) for control elements. It is true for both WPF and
Silverlight. Usually templates are a kind of layout, containing elements for a
user interface definition. Triggers are usually used when there is a need to
define some appearance changes depending on any condition. For these purposes a
property or event is used to trace the moment of a control element state
changing.
This approach is good in case of simple logic. However, it
is easy to understand that logic of triggers will be really confused in cases
where there are a multiple set of conditions or it is necessary to supervise
some conditions simultaneously. In some cases creation, debugging and support
for such applications can become a big hell for a developer or designer.
To resolve this conceptual problem there is a suggestion to
have another look at user interfaces development. It is proposed to define a
set of conditions based on representation of definition for a control element
instead of triggers and behavioral representation. In this case every control
element will be in some state, and appearance depends on the current state of a
control element.
The definition of control elements appearance that is based
on states is considered in the article where you can read about the convenient
way to set visual representation of control elements.