-
FEATURED COMPONENTS
First time here? Check out the FAQ!
The new Cardlayout and Scrollview are great components, but I don't see a way to apply a model so the content can be dynamic.
Once again, the examples unhelpfully use static children or script/zscript supplied children.
I'm at a loss of how to supply a dynamic set of images as children to either of these components - under MVVM, since neither component appears to support a children or model attribute.
Hi rdgrimes,
To supply a dynamic set of images as children to Cardlayout or Scrollview under MVVM, we can use children binding with <template>,
as following:
<cardlayout children="@load(vm.imgSrcSet)" width="300px" height="200px" selectedIndex="1">
<template name="children">
<image src="@load(each)"/>
</template>
</cardlayout>