Thursday, September 16, 2010

DataContext And ItemSource In Silverlight

In this article want to explain some of defferences between datacontext and itemsource properties in silverlight. these two properties will serve different purpose.

1.Datacontext will take object type where as itemsource will allows IEnumerable type object.

2.Datacontext is a dependency property exposed by the framework element base class and itemsource is defined/exposed by the itemscontrol class.

3.Datacontext can be hold common data object so that child controls can be inherited.But in case itemsource cant be used within visual tree. It can be used only for that control.


No comments:

Post a Comment