Don't sort Alias TableView while bulk changes are applied #1039
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the user has selected a column to sort by on the TableView in the Alias editor, the table's backing SortedList will resort every time an ObservableProperty of an Alias is modified. This can cause the UI to lock up for minutes at a time if many Aliases are modified at once using the AliasBulkEditor.
This change works around this issue by simply resetting the SortedList's ComparatorProperty while the AliasBulkEditor is applying changes, and rebinding it back to the TableView's ComparatorProperty once AliasBulkEditor has finished.
This change seems a bit hacky to me but it's the cleanest thing I could come up with. I couldn't find a way to set a property's value to null via a binding, so unbinding and rebinding had to do. I hope that I'm missing a simple solution to this problem because this isn't the only instance of UI updates slowing stuff down when many changes are being made at once, and manually pausing slow elements while changes are made is annoying and a maintenance nightmare. Regardless, in the meantime this change makes the Alias editor a lot more usable and it is easily reversible should a better solution be proposed later.