Show warning when using non-IEnumerable property in ItemsSource

Here's an idea for simple yet really usefull inspection, that could be easily added to XAML Inspections - when Binding is used on ItemsSource, but the target property is not any IEnumerable type, show warning, because that's probably not what user wanted to enter into the Binding.
It just happened to me right now, I was wondering for half an hour why no item is shown in my ItemsControl? I used ItemsSource="{Binding SelectedGroup}" but the proper binding there should have been ItemsSource="{Binding SelectedGroup.Items}".
Thanks

0

Please sign in to leave a comment.