I've created a (System.Windows.Controls.Primitives.)Popup that contains a Treeview that I'm populating with data read in from a file. The Popup is created in code rather than in xaml. I want to add checkboxes to the treeview in a similar way to the CheckedTreeViewItemSample.xaml that comes in the Silverlight Toolkit.
I'm having trouble converting the xaml into code because I don't really understand how the HierarchicalDataTemplate works and how the bindings work. In fact I find the Silverlight object model pretty confusing!
I've done quite a bit of searching but I haven't found how to do it in code-behind. Will I need to define the xaml and use the XamlReader?
Thanks in advance...