c# - WCF To WPF client - Populating the ListBox -


that method populating listbox data comes wcf service.

private void filllistbox()         {             servicereference1.service1client client = new servicereference1.service1client();             client.open();             listbox.itemssource = client.getallproducts();                     } 

but in listbox can see

productlistclient.servicereference1.product 

therefore have added override tostring() method in model, still can not see data in listbox. how can fix that?

it seems binding working , list contain items. need implement itemdatatemplate in listbox this:

<listbox width="400" margin="10"          itemssource="{binding source={staticresource mytodolist}}">    <listbox.itemtemplate>      <datatemplate>        <stackpanel>          <textblock text="{binding path=taskname}" />          <textblock text="{binding path=description}"/>          <textblock text="{binding path=priority}"/>        </stackpanel>      </datatemplate>    </listbox.itemtemplate>  </listbox> 

ignore naming of example. need adapt names of objects in application


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -