views:

49

answers:

1

It would make life so much easier!

+2  A: 

This is completely impossible.

When you run a WPF app, the XAML is parsed in the constructor into a visual tree, which is then displayed as a form.

Edit & Continue would mean re-creating the visual tree, which would break any code in the form.

SLaks
I wouldn't say "completely impossible". They could take a diff between the old and new XAML, then apply that diff to the current visual tree. It wouldn't be perfect, probably limited to mostly attributes, but even that would be useful.
Jonathan Allen
@Jonathan: It would be very difficult to do and probably wouldn't work reliably. Remember that the visual tree can be changed in code, and that there is no connection between an element and the XAML that it (may have been) parsed from.
SLaks
Starting with something limited but useful: 1. Only allow changing attributes on named elements. 2. Lookup those elements using reflection on the form's properties. 3. Assign the new values to the properties that match the attributes. I'm sure you could implement this as a function Fixup(oldXaml, newXaml, openForms) in an hour.
Jonathan Allen
yeah, completely impossible seems like a challenge to me! ;)
miguel