wpf - scrollviewer the property 'content' is set more than once -
here code:
<grid style="{staticresource layoutrootstyle}"> <grid.rowdefinitions> <rowdefinition height="140"/> <rowdefinition height="*"/> </grid.rowdefinitions> <scrollviewer grid.rowspan="2" style="{staticresource horizontalscrollviewerstyle}" horizontalscrollbarvisibility="visible" > <!-- elements want horizontally scrollable goes here --> <!-- horizontal scrolling grid used in view states --> <gridview name="itemgridview" automationproperties.automationid="itemsgridview" automationproperties.name="items" tabindex="1" padding="100,136,116,46" itemssource="{binding source={staticresource itemsviewsource}}" itemtemplate="{staticresource standard250x250itemtemplate}" selectionmode="none" isswipeenabled="false" isitemclickenabled="true" itemclick="itemview_itemclick"/> <button hello /> <!-- here come error --> </scrollviewer> </grid> when add thing after gridview, give me error (the property content set more once).
the answer right there in error message. scrollviewer can have 1 child (you have two, gridview , button). if want add multiple things, have wrap them in panel allows multiple children (e.g. grid).
Comments
Post a Comment