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

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -