I can’t find a good answer for what I am trying to do so if anybody knows an already existing thread or can explain whats the best way to do it that would be great.
Currently I am using ScriptableObjects to “save” lists in the editor because they are easy to manage as an asset and get serialized.
The listview.itemSource is set to the selected list and whenever something is changed, it changes on the SO but when I reopen the editor nothing was saved.
I have to call SetDirty() on the SO and SaveAssets(), as well as Rebuild the listview because the source has changed.
Am I doing this right or is there a better way to save/sync lists (in a managable way) for a listview ?
Ok, that seems to be what I was looking for but everything is broken now. That binding stuff with UIElements is still confusing me despite reading the documentation multiple times.
Getting a list of SerializedObjects of my ScriptableObjects worked.
I cant bind a property with .Bind(), did you mean .BindProperty() ?
My whole layout is bugging out now. Its showing the correct amount of items so I am guessing its correctly bound but the connections that where setup in .bindItem dont seem to work anymore because the .itemSource is null.
I got binding to work and deleted pretty much most of my code anyways because I dont need it anymore.
The listview was bugging because the .makeItem was also applied to the size field.
But I just realised something different. Every item has a description that shows as tooltip on a label.
I can bind the title to the label but not the description to the tooltip like I had it before.
Unless I am somehow able to access the item within .makeItem.