According to this answer:
- When you implement
INotifyPropertyChanged
on a ViewModel, WPF binds to that ViewModel using a lightweightPropertyInfo
object. - When you don't implement
INPC
, WPF creates heavierPropertyDescriptor
objects for each property on the ViewModel and binds onto them instead, with the caveat that it can't detect changes made from within the ViewModel.
But what about common CLR types that are often bound to, but don't implement INPC
, like string
, int
or T[]
?
- Does WPF have some mechanism for detecting these types and binding them as special cases, or do they get the
PropertyDescriptor
treatment? - If they are special-cased, is there somewhere a complete list of which types are treated that way and are "safe" to bind to without fear of the performance hit associated with
PropertyDescriptor
?
I'm specifically wondering about the types that feel to me to be "one tier up" from those above, like List<T>
, Dictionary<TKey, TValue>
, ValueTuple<...>
and Exception
.