The following XAML (below) defines a custom collection in resources and tries 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 message in the constructor “MyCustomCollection type does not support direct content.” I tried setting ContentProperty as recommended on MSDN, but I can’t figure out what to install it. The custom collection object that I use below and very simple.I tried Item, Items and MyCustomItem and can’t think of anything else to try.
<ContentProperty("WhatGoesHere?")> _ Public Class MyCustomCollection Inherits ObservableCollection(Of MyCustomItem) End Class
Any clues as to where I'm going will be mistakenly received. Also hints on how to dig into the WPF object model to see which properties are displayed at runtime, I can understand this too.
Hi
Ryan
wpf designer
Ryan o'neill
source share