In this episode of the Hanselminutes podcast, guest Laurent Bugnion (creator of MVVM Light) describes that there is a performance hit associated with using converters. He indicates that it is almost always negligible in desktop applications, but that in WP7 applications, it is recommended that viewmodels expose things like brushes directly, rather than relying heavily on converters, especially if dealing with list virtualization, in which case scrolling will cause many invocations of the conversion.
It is possible that a similar thing is occurring in your scenario, just given the volume of triggers (or conversions if you made that switch).
As a proof of concept, you might consider wrapping your view-model in a "WPF Viewmodel," that exposes the colors and other WPF-specific values themselves, rather than some value from which the colors can be determined by the runtime invoking triggers and IValueConverters
. You'll then be able to bind directly to that, and use neither triggers nor converters. I'd be interested to hear the results.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…