c# - Windows 8 store app: How dynamically change Binding in ListViewItem -


i have created common control listview , want change content of each item in listview. displaymemberpath need send 2 values ​​that not same 1 screen.

<listview.itemtemplate>     <datatemplate>        <grid>           <textblock text="{binding property1}"/>          <textblock text="{binding setter2}"/>        </grid>      </datatemplate> </listview.itemtemplate> 

and on next screen want this

        <textblock text="{binding supernewproperty}"/>          <textblock text="{binding setter2xyz}"/> 

how create control has variable binding like:

<textblock text="{binding {binding myspecificvalue}"/> 

this stupid thing, best describes want do.

for completion:

ok have module employes.xaml call, control dependency properties itemsource , prop1, prop2(i want use both, display member path).

itemsource ienumerable db , contains 2 columns: employename, employnumber, displayed on listview

<control:listviewmycontrol itemsource ="{binding employes}" prop1="employename" prop2="employnumber" /> 

but when have modul cities.xaml need binding prop1, prop2 column name, cityname, cityrank or whatever

<control:listviewmycontrol itemsource ="{binding cities}" prop1="cityname" prop2="cityrank " /> 

the problem comes when want display 2 different types of listviewitems listview

   // user control listviewmycontrol      <listview x:name="listview1">     <listview.itemtemplate>         <datatemplate>            <grid>               <textblock text="{binding employename}"/>              <textblock text="{binding employenumber}"/>              <textblock text="{binding cityname}"/>              <textblock text="{binding cityrank}"/>     // want display member path 2 labels, input modules may more (employes, cities, cars, stations, .....)     <textblock text="{binding {binding myspecificvalue}"/>     <textblock text="{binding {binding myspecificvalue2}"/>             </grid>          </datatemplate>     </listview.itemtemplate>     </listview> 

thanks in advance.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -