This project is read-only.

Editor for Collections

Aug 20, 2010 at 12:29 PM
Edited Aug 20, 2010 at 1:27 PM
I've been googling for a looong time now and have read through about ever discussion in this board.
I'm trying to build e TypeEditor for e Collection of Playlists in my applications model. That looks like te following:

public class PraiseSightApp
{
     private void PraiseSight()
     {
         _Playlists.Add(new Playlist());
     }

     List<Playlist> _Playlists = new List<Playlist>();
     public List<Playlist> Playlists
     {
         get
         {
             return _Playlists;
         }
         set
         {
             _Playlists = value;
         }
     }
}

After digging a wile I found, where the DataTemplates for the diffrent Types are stored - in the WPGTemplates.xaml. So I've added another DataTemplate which looks like this:
<DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyGrid}, ResourceId={x:Type clr2:IList}}">
	<TextBox>Hello</TextBox>
</DataTemplate>

But running this, the PropertyGrid only displays the normal TextBox with the Content: System.Collections.Generic.List`1[PraiseSight.Playlist]Does anlybode here know how I could make the PropertyGrid display the above Datatemplate, whenever it findes a BindingList on the Object?
I'm very grateful for anz advice on this topic.
Michael