Suppress command dispatching during view building
manio143 opened this issue · comments
Marian Dziubiak commented
FuncUI executes subscription methods when creating a control, not just when patching it later. This leads to unnecessary commands being dispatched initially, and furthermore invalid reversible commands registering in undo/redo.
Fix: add a state to dispatcher (bool + lock object) that is set during view update - this also means that initial view update should be a result of dispatching a InitializeEditorCommand
which does nothing, but forces view update.
Marian Dziubiak commented
Decided not to introduce a new command, but rather schedule view update in SetActiveEditor
.