Now I've got... [counts...] six copies of the header coming up.
More is better, right? <.<
"My code is now 300% more performant."
The Untanglenating continues...
The problem seems to be with elements that have sub-elements, apparently getting rendered via 2 different paths...
Got it back down to two copies, but my brain is just utterly frazzled by how to make this maintainably debuggable.
Maybe it is time to rethink how it works...
Throwing idea-spaghetti at the wall: howbout I have, liek, an XML doc for the page as a whole, and elements of that can refer to other XML docs for sub-elements...
- Question from the class: Why is that any better?
- Answer: uhhh... you obviously didn't read last night's seven chapters of documentation that I assigned. I forgot? Well, you should have done them anyway. Class dismissed... <runs away>
I think the problem may originate with trying to treat [rendering] more like the other two types of events. It was previously a separate dispatch chain.
This may be another case of I Thought I Was Being Clever.
...cuz I've ended up partly implementing that separate dispatch chain anyway, and sorting that out has been the major cause of the last 10-20+ hours I've spent on this.
- each element calculates its render output during OnFigure, and stashes that in a variable which can be accessed by, uh, GetRendered() ocelot
- OnRender() just goes through and sums those up. No other dispatch allowed. (All the dispatching would be during OnFigure().)
That way, we maintain clarity about what's being added to the output and what's just being calculated for something else to use.
Sounds nice in theory...
...but I kinda feel like we'll end up in the same spot, somehow...
Oh, here's one way out of the trap: if a parent-object uses the output of GetRendered(), it can clear that so it won't get used again.
...and actually, let's make it automatic: retrieving the rendered output clears it.
Okay, I need to figure out what the heck I was trying to do with Kiosk objects...