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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -