Image (gallery basket) template (HTML)

[ This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation ]

Defines an item in an image gallery basket. This template is for use with a ListView that has a grid layout. For additional templates, see Item templates for grid layouts and Item templates for list layouts.

To use the template

To use the template, copy the HTML and the CSS styles into your project. The HTML includes a ListView that's designed to be used with the template. After you copy the HTML, set the ListView control's itemDataSource to your app's data source and update the template's data-win-bind attributes so they work with your data.

HTML

<!-- Item template -->
<div id="imageGalleryBasketTemplate" 
     data-win-control="WinJS.Binding.Template">
  <div class="imageGalleryBasket">
    <img class="imageGalleryBasketImage" 
         data-win-bind="src: imageUrl"/>
  </div>
</div>

<!-- ListView -->
<div id="imageGalleryBasket"
    data-win-control="WinJS.UI.ListView"
    data-win-options="{ itemDataSource: list.dataSource, 
      itemTemplate: select('#imageGalleryBasketTemplate'), 
      layout: { type: WinJS.UI.GridLayout } }">
</div>

CSS

/* overall list dimensions */
#imageGalleryBasket
{
    width: 1366px;
    height: 68px;
}

/*-------------------------------------------------------------------------------------------*/
/* image-galleryBasket - used in Picker gallery basket */
/*-------------------------------------------------------------------------------------------*/
    /* starting margin */
    #imageGalleryBasket .win-horizontal.win-viewport .win-surface
    {
        margin: 0px 115px;
    }

    /* individual item dimensions */
    .imageGalleryBasket
    {
        width: 58px;
        height: 40px;
        overflow: hidden;
    }
    
        /*image*/
        .imageGalleryBasket img.imageGalleryBasketImage
        {
            width: 58px;
            height: 40px;
            overflow: hidden;
        }

Item templates for grid layouts

Item templates for list layouts