Home > Silverlight > Differences between control templates and Data templates

Differences between control templates and Data templates

Hi,

Most of the time during the development of silver light, question that raises is whether to choose Data template or Control Template. To help people, I’m sharing my observation differences between Control Templates and Data templates.

Here are following differences which i have observed,  i request viewers to add in some more points , if in case I miss points

  • Data Template is used to create a visualization of a non-visual object, such as a business object
  • Control Template used for visual representation of a UI control, such as a Button or List View etc
  • Data Template is used to provide visual structure based on underlying data.
  • Control Template has nothing to do with underlying data, it provides visual layout for the control
  • Control template uses Template Binding for binding to properties of its parent ,where Data templates uses data binding to the properties of Data context.

If we are planning to represent Data in UI then we should use data template and if we are modifying styles of control ,then we use control template.

In case if i missed any point and please provide points in reply.

-Mahens

Advertisements
Categories: Silverlight
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: