Search code examples
windows-8winjs

Dynamic template in listview (WinJS) in windows 8


I have a windows 8 application with a simple listview in a list layout. I have fetched my blog items (syndication), now what I want to achieve is add a dynamic item that will function as a "load more" button. To do this, I want to specify a different template just for this item. The sample I have found uses a function template, which really isn't very versatile since I have to load all template elements using JavaScript. Is there a way to dynamically specify a WinJS.Binding.Template based on an item property?


Solution

  • An excellent article on the subject

    http://stephenwalther.com/blog/archive/2012/05/23/metro-dynamically-switching-templates-with-a-winjs-listview.aspx