I've spent the last couple of nights struggling with WPF user/custom controls.
Currently I am adding usercontrols to the children collection of a canvas in the MainWindow OnInitialized() override, getting the data to create the child from the database.
Now ideally this could all be done declaratively, by binding an observable collection to a custom control which can handle the user control creation and presentation, and encapsulating all that logic in the control rather than the main window.
I've got a user control which for now just exposes a couple of properties such as name, and has a really simple bit of xaml for the presentation.
I've tried subclassing canvas (the data collection stores the coordinates to display the usercontrol at), and calling from the constructor the GetData method for the collection, and adding a new usercontrol for each entry to the Children collection, but they don't render.
Also if I wanted to take this one step further so I could do all of this from EID, how would I make both the Children and/or a custom property appear as bindable in EID (I've tried putting [bindable(true)] as a property attibute) and if I can do that how about making my user control appear as a template object for the collection Item
Any help appreciated.
Cheers
Simon

Custom/User Controls
drinkingredvodka
Kevin,
Very helpfull, a bit of searching revealled this
http://www.i-constructions.com/myblog/avalonpositiondatabinding.html
which is very close to what I want to do. I am in fact returning data which contains coordinates in latitude and longitude so I will need to do some processing of that data, but that should be fairly simple.
Lukan
P.D.
You want an ItemsControl here.
ItemsControl allows you to define a Panel and bind a collection (like ObservableCollection).
ItemsControl handles putting the items in the collection into the Panel using a defined DataTemplate.
I'd start there.