Hey folks.  I have a renderer that needs information that is not based on
the "data" object it's associated with.  Essentially what I have is in View
A of the app is a color selector.  In View B, I have a tilelist with a
custom renderer.  All the renderers in the tile list display their data
using the color that was selected in Part A.  The way I see it, the color
selected in Part A should be kept separate from the "data" object that gets
injected into the item renderers.  The color is just to make the data pretty
in some way, it's not really "data" itself nor is it specific to an
individual data object--it applies to all renderers in the list. This leads
me to somehow keep the renderers updated with a separate "color" property.
What's your preferred way of handling this scenario?

Things I've thought of so far:

(1) If I have an application-wide model (like in Cairngorm) I can set a
color property there and either access it using the singleton accesor from
within the renderer (cringe) or pass the model into the renderer using a
class factory.  Since the model instance shouldn't really ever change, I can
then watch the model for changes to the color property.

(2) Whenever the color changes, I can grab all the renderers for the given
list and set their color property (cringe).

Thoughts?

Aaron

Reply via email to