Changing the DataTemplate based on the Available Space – SizeBasedTemplateSelector - by LearnWPF
DataTemplates are a pretty useful feature in WPF, but wouldn’t it be great if you could change the data template based on the size available to display the data? Several media players (including the Zune player) present a kind of ‘postage-stamp-sized’ UI when shrunk below a certain size. Date columns in the Finder in OSX are another example of UI that adjusts to the available space – as the width of the column increases the format of the date changes to show more information. I wanted to bring this kind of capability to WPF.
Read More from: Original Source
Post Contributed by: Kunal Chowdhury
Kunal is the Site Admin and Contributor of Silverlight-Zone. He is a Software Engineer, Microsoft Silverlight MVP, Code Project Mentor and a Code Project MVP. He is also an active Author in SilverlightShow.net and a speaker in various community events. He works on Microsoft Platform and very passionate about Silverlight technology. He started his career in 2007 and achieved various awards during his professional life.
He shares his findings in his personal blog: http://www.kunal-chowdhury.com and he also tweets at: @kunal2383.