I'm trying to implement RadDocking using DockingPanesFactory as per your examples (like this one).
I have set the PaneSource to a collection of viewmodels e.g. MyViewModel which has a property "Name".
I would like to bind the RadPane header to the "Name" property on the viewmodel. Ideally I would like to have a custom DataTemplate as well but I will settle for just getting the value to update with the ViewModel.
The CreatePaneFromItem method states that "...set any of the DataContext, Header, Title or Content based on the item as well as Style with bindings in the style setters to bind properties of the item to properties of the RadPane" however nothing I've tried seems to work.
I've tried setting a style with the setter properties like this:
var pane = new RadPane(); pane.DataContext = (MyViewModel)item; Style style = new Style(); style.TargetType = typeof(RadPane); Setter setter = new Setter(); setter.Property = RadPane.HeaderProperty; setter.Value = new Binding("Name") pane.Style = style;
Ideally I'd like to define a DataTemplate in a ResourceDictionary and retrieve and set that to the pane header but I'm not sure how to get that resource in the DockingPanesFactory
Can you offer any advice?