c# - Data Binding UserControls to WrapPanel -


i'm trying work out how data bind list of usercontrols wrappanel i'm not having luck searching around.

i'm pretty new wpf (come on winforms), @ moment adding usercontrols children @ runtime. there solutions know wrappanels don't support data binding.

try this:

<listbox scrollviewer.horizontalscrollbarvisibility="disabled" itemssource="{binding yoursource}">     <listbox.itemspanel>         <itemspaneltemplate>             <wrappanel isitemshost="true" />         </itemspaneltemplate>     </listbox.itemspanel>     ... </listbox> 

if don't need selection stuff, can try itemscontrol.

<itemscontrol itemscontrolscrollviewer.horizontalscrollbarvisibility="disabled" itemssource="{binding yoursource}">      <itemscontrol.itemspanel>            <itemspaneltemplate>                    <wrappanel isitemshost="true" />                </itemspaneltemplate>      </itemscontrol.itemspanel>      ... </itemscontrol> 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -