focustense / easymod

Modding for the modern age.
44 stars 2 forks source link

Feature Request: tables remember sort order, column widths, etc. #170

Open geraintwd opened 2 years ago

geraintwd commented 2 years ago

Would it be possible to have tables, such as the NPC details table on the Build tab, remember things like column widths, sort orders, when switching back and forth between tabs? While I'm editing NPCs one-by-one, I have to switch between the Profile and Build tabs, and the table resets to defaults each time.

focustense commented 2 years ago

This is definitely a huge pain, even in development.

Unfortunately there's not an easy solution; WPF gives you this nice sorting/sizing/etc. on data grids for free, but if you want to persist any of it, you have to throw all of that away and manually implement the whole thing using a tangle of code-behind and XAML. It's basically this, but even more work to make it work with MVVM.

It's been going on for 10 years and Microsoft still hasn't provided a solution that isn't nails-on-a-chalkboard aggravation. Some people have posted snippets of solving little pieces of the problem, like column ordering on its own, using interaction behaviors. I could try that as well, it just has its own set of issues, namely that each property to be persisted (size, order, sorting, etc.) is its own little island with no convenient way to make sure it's all properly covered.

Because of all that, I don't anticipate having a solution come out in a near-term point release, but it definitely is an issue and I'll keep it open for future, longer-term stuff.