wpf - 'View cannot be shared by more than one ListView' System.Windows..ListView -
i'm trying set view listview
dynamically: exception 'view cannot shared more 1 listview
' although i'm using once. anyways if make instance already, , datatrigger
triggers, exception takes place too.
this wpf code:
<listview itemssource="{binding collection}" selectionmode="extended" alternationcount="2" > <listview.style> <style> <setter property="listview.view" value="{staticresource myview1}" /> <style.triggers> <datatrigger binding="{binding path=mypath1}" value="true"> <setter property="listview.view" value="{staticresource myview2}" /> </datatrigger> <datatrigger binding="{binding path=mypath2}" value="true"> <setter property="listview.view" value="{staticresource myview3}" /> </datatrigger> </style.triggers> </style> </listview.style> </listview>
and resources:
<gridview x:key="myview1"> <gridviewcolumn displaymemberbinding="{binding path=myproperty}" > <gridviewcolumnheader content="text" /> </gridviewcolumn> </gridview> ..
use dynamicresource
rather staticresource
.
see this question full code.
Comments
Post a Comment