This project is read-only.

DataTemplate for Vertices

Jun 22, 2009 at 1:56 AM
Edited Jun 22, 2009 at 1:57 AM

I'm having some trouble with getting DataTemplates to work.  The code I'm trying to get this working in is possibly a little strange:

The class I'm using as my Vertices is in a dynamically loaded assembly.  All vertices implement an interface (IEntity) which is in the local assembly.

I've tried adding a DataTemplate with DataType="{x:Type pluginmodel:IEntity}" in Window.Resources (I think that's how it's done in the sample...) but this doesn't seem to work for me.


Am I trying to do things the right way?  Would it help if I used a wrapper class in the local assembly to hold my IEntity objects?


Jun 22, 2009 at 8:01 AM

Don't worry - it was my mistake.  DataTemplates don't support interfaces.  I created a wrapper UserControl, and this shows up without needing to use a DataTemplate.


I would appreciate it if someone could let me know if I was barking up the right tree though?

(Ie, would this have worked if it wasn't for the Interface issue?)


Thanks for writing the graphing layout library I've been searching for since 2006 :)

Sep 1, 2010 at 3:40 PM

@bgreene Would you post your code so that others can benefit from your work?

Sep 15, 2010 at 1:21 AM

Yes, I agree - I'd very much like to see how you added a custom UserControl for different types of entities.

Thank you!