Applying Control Templates

You have now seen how we can define a style resource and apply it to controls, but what if we want to completely change the appearance of the control, including the appearance or function of its elements not exposed by the control as properties? In Silverlight, this is actually possible by applying an alternate control template to the control (in place of its default template). The structure of Silverlight custom controls encourages a separation between the control's presentation and behavior. The behavior of the control should be defined in the code, and its appearance should be defined in the control template. Between the two is a contract defining what the code needs access to from the presentation layer. With this ...

Get Pro Business Applications with Silverlight 5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.