valueconverter - is it a bad idea to have static wpf value converters? -
instead of declaring converter in resources, can like
isenabled={binding path=someprop, converter={x:static namespace:converter.instance}}"
where instance instantiated once (lazy sinlgeton)
but i'm worried keeping references static variables might in way of garbage collection when disposing views (i'm using prism). think?
indeed static instance of converter won't garbage collected, it's 1 instance, , typical converters have no (or few) data fields, it's nothing worry about...
the converter has no reference views, shouldn't problem garbage collection of views.
Comments
Post a Comment