Kaloyan,
Maybe you can forward my question to Miroslav if you're not sure of the answer..
I looked at the custom Region Adapter Miroslav built. What I find interesting is that he is using a radPane for both the Document Host and the normal Docking control. I thought the Document Host needed a radDocumentPane ... does radDocumentPane inherit from radPane and that's why it works?
I need to dynamically add both radPanes and radPaneDocuments at runtime. This is based upon a lookup to a web service to see what modules the user has been granted access to and then load them.
Note that I haven't tested this thoroughly and will be in the coming week.
My custom Region adapter tries to handle both radPanes and radPaneDocuments types by branching on the value of the Tag property from the incoming module control (an ugly workaround I know). For example, the Add action code block is as thus:
string ModuleTag = CurrentElement.Tag.ToString();
UserControl CurrentElementAsUserControl = CurrentElement as UserControl;
string[] paramModule = ModuleTag.Split(';');
switch (paramModule[0])
{
case "multipane": //pane gets added to existing RadPanegroup
RadPane PaneToAdd = new RadPane();
//embed the content
PaneToAdd.Content = CurrentElementAsUserControl;
//make sure any data bindings are maintained
PaneToAdd.DataContext = CurrentElementAsUserControl.DataContext;
regionTarget.AddItem(PaneToAdd,
DockPosition.Left);
break;
case "docpane": //pane gets added to existing RadPaneGroup inside of document host
RadDocumentPane DocPaneToAdd = new RadDocumentPane();
//embed the content
DocPaneToAdd.Content = CurrentElementAsUserControl;
//make sure any data bindings are maintained
DocPaneToAdd.DataContext = CurrentElementAsUserControl.DataContext;
regionTarget.AddItem(DocPaneToAdd,
DockPosition.Left);
break;
default:
//unknown type of module to embed
break;
}
Also note that if the module has existing data bindings they need to be maintained via assignment of the DataContext property.
Does this look sane to you?
Regards,
Paul from Minneapolis