Hi,
The following XAML (below) defines a custom collection in resources and attempts to populate it with a custom object;
<UserControl x:Class="ImageListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="300" Height="300"
xmlns:local="clr-namespace:MyControls" >
<UserControl.Resources>
<local:MyCustomCollection x:Key="MyKey">
<local:MyCustomItem>
</local:MyCustomItem>
</local:MyCustomCollection>
</UserControl.Resources>
</UserControl>
The problem is that I get an error in the designer of 'The type 'MyCustomCollection' does not support direct content'. I've tried setting ContentProperty as advised in MSDN but can't figure out what to set it to. The custom collection object which I use is below and is very simple. I've tried Item, Items and MyCustomItem and can't think of what else to try.
<ContentProperty("WhatGoesHere?")> _
Public Class MyCustomCollection
Inherits ObservableCollection(Of MyCustomItem)
End Class
Any clues as to where I am going wrong would be gratefully received. Also hints on how to dig down into the WPF object model to see what properties are exposed at run-time, I might be able to figure it out that way too.
Regards
Ryan