DockPanelSuite LoadFromXML does not work?

618 views Asked by At

Loadfromxml does not seem to work. It reads the XML file, then branches to the function that returns the forms to load, and that returns the forms, but it never loads the forms. They never appear. Any ideas what I'm doing wrong? Code snippet below

DockPanel.LoadFromXml(configFile, AddressOf ReloadContent)
...

Private Function ReloadContent(ByVal persistString As String) As IDockContent
    Try
        Debug.Print(Now() & " start ReloadContent " & persistString)
        Me.Cursor = Cursors.WaitCursor
        Select Case persistString
            Case "PIX4.frmTreeView"
                Return frmTreeView
        ...
1

There are 1 answers

0
Incubus On

If you look in the example directory in the file Mainform.cs you can find an example of this, using the function "GetContentFromPersistentString". There you see they use

        if (persistString == typeof(DummySolutionExplorer).ToString())
            return m_solutionExplorer;

I changed your function a bit and this works (for me, testing with frmtoolbox):

Private Function ReloadContent(ByVal data As String) As IDockContent
    If data = frmToolbox.GetType.ToString Then Return frmToolbox
    Console.WriteLine(data) 'show the missing type
    Return Nothing
End Function

probably use a better compare function for string :)