I believe we cannot bind to internal viewmodel.
Therefore I think all binding related implementations of IValueConverter, IMultiValueConverter, INotifyPropertyChanged, INotifyCollectionChanged should be always public in order to work with XAML.
Is that correct?
UPDATE: this isn’t such an easy question because there are various possible weird cases, like nested viewmodel classes, or explicit interface implementations or something else that I am not aware of which could possibly lead to different answers. As we already can see WPF and SL4.0 treat internal viewmodels differently for some reason.
Did some checking, based on this code:
Interestingly enough, results are different for WPF and Silverlight.
And answers are:
In Silverlight:
“I believe we cannot bind to internal viewmodel” – yes we cannot
bind to internal class, nor can we bind to internal or private
properties, gives binding error.
“implementations of IValueConverter, IMultiValueConverter” – yes also should be public
“INotifyPropertyChanged, INotifyCollectionChanged” – these interfaces are implemented by classes of ViewModel and some collection that will be bound, so these classes should be public as we already know. And methods and events that implement interfaces cannot be private or internal obviously.
In WPF:
“I believe we cannot bind to internal viewmodel” – we can bind to internal class, but we cannot bind to internal or private properties.
“implementations of IValueConverter, IMultiValueConverter” – can be internal
“INotifyPropertyChanged, INotifyCollectionChanged” – see previous points.