tags:

views:

87

answers:

1

Instead of declaring the converter in the Resources, i can do something like

IsEnabled={Binding Path=SomeProp, Converter={x:Static namespace:Converter.Instance}}"

where Instance is instantiated only once (lazy sinlgeton)

But i'm worried about keeping references to static variables might get in the way of garbage collection when disposing the views (i'm using PRISM). What do you think?

+1  A: 

Indeed the static instance of the converter won't be garbage collected, but it's just one instance, and typical converters have no (or few) data fields, so it's probably nothing to worry about...

The converter has no reference to the views, so it shouldn't be a problem for garbage collection of the views.

Thomas Levesque