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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.