Commit ff7cff0
Properties panel: dont rebuild while user is mid-edit
The 4 Hz binding-value refresh in OnRenderTick was unconditionally
calling UpdatePropertiesPanel() whenever the selected node had any
property binding and the graph had dirty nodes -- which is every
single 250 ms tick on a Clock-driven graph. UpdatePropertiesPanel
calls panel.Children().Clear() then rebuilds the entire control
tree from scratch, which destroys whatever XAML control had keyboard
focus.
Symptom: with a complex graph + playing Clock + a node with bindings
selected, clicking into a TextBox / NumberBox / ComboBox to edit a
property had a < 250 ms window before the rebuild blew away the
focused control. Effective lag on first successful edit:
pseudorandom 0..20+ seconds depending on click timing.
Fix: walk the focused elements parent chain via VisualTreeHelper and
skip the periodic rebuild while any descendant of PropertiesPanel
holds focus. The user-driven rebuild paths (selection change,
property mutation) are unaffected -- they always rebuild.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 1e91a8a commit ff7cff0
3 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
250 | 257 | | |
251 | 258 | | |
252 | 259 | | |
253 | | - | |
| 260 | + | |
| 261 | + | |
254 | 262 | | |
255 | 263 | | |
256 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2644 | 2644 | | |
2645 | 2645 | | |
2646 | 2646 | | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
2647 | 2672 | | |
2648 | 2673 | | |
2649 | 2674 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
345 | 350 | | |
346 | 351 | | |
347 | 352 | | |
| |||
0 commit comments