manio143 / StrideComponentsEditorAvalonia

Experimental mini Stride.Editor in Avalonia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suppress command dispatching during view building

manio143 opened this issue · comments

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.

Decided not to introduce a new command, but rather schedule view update in SetActiveEditor.