Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Bind DataTable to repeated user controls
    primarykey
    data
    text
    <p>I'm in the process of teaching myself WPF, and I have run into a small issue that I can't find the answer to.</p> <p>My test app allows image files to be dropped into a StackPanel. Once an image is dropped, a new user control is added to the stack, and displays some meta-data about the file. All is working correctly, and I can iterate through the child controls to retrieve the values.</p> <p>What I'd prefer to be able to do is allow the user to persist this data to a file, so they can suspend working on the data. The obvious way for me to do this is to store the data in a DataTable and serialise/deserialise it to xml. However, I don't know how to drive the collection of user controls from a DataTable or DataSet object - in fact, I don't even know if this is the right way to go about it in a WPF app. I am more than willing to admit my ignorance here and take better suggestions if there are any.</p> <p>Summary of the app logic.</p> <p>1) File is dropped (from Win explorer) onto a StackPanel<br> 2) File triggers creation of a new user control, which is added to the StackPanel<br> 3) Data is populated in the user control<br> 4) Processing data involves iterating through the control collection. </p> <p>What I'd like</p> <p>1) File is dropped (from Win explorer) onto a StackPanel<br> 2) File data is inserted into some persistable object (data table?)<br> 3) updated data table drives the generation of the user control to be added to the displayed collection.<br> 4) save / load functionality persists the data for re-use later. </p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload