locked
How to load item templates / fragments from resource

    Question

  • I would like to have only on itemTemplate that I would like to reuse in different listviews throughout the application.

    Therefore I would like it to be in a separate file called "defaultItemTemplate.html" that I would like to load in certain pages. Whats the WinJS API to load such templates from files and could I use the same mechanism to load fragments that I would like to append to the AppBar programmtically?

    Tuesday, February 07, 2012 6:51 PM

Answers

  • Hi Phil,

    You can programmatically bind templates.  You could use this to your advantage if you wanted to share from a common source.  Simply load the page, clone the fragment and use that in your code.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, February 07, 2012 9:03 PM
    Moderator