Yes, that solves all the problems. Each time you use the thing is it automatically back in its base state and is able to be adjusted correctly prior to assigning to the dialog. When the dialog is closed remember any details from it and then dispose of it correctly.
Add a property of say called AccessoryPanel of the type of your DesktopContainer.
Private Property AccessoryPanel As conLoadSaveOptions
In the code where you are instantiating the NSOpenPanelGTO or NSSavePanelGTO. do the following:
AccessoryPanel = New conLoadSaveOptions ' my Desktopcontainer class
AccessoryPanel.LockLeft = false ' lock it so as it keep it off the edge of the window
AccessoryPanel.LockRight = true
AccessoryPanel.EmbedWithin self, self.width + 20, 324, 800, 276 ' Add it off the edge of the window
Now you can assign properties to AccessoryPanel as you wish.
mDialog.AccessoryView = AccessoryPanel ' Assign it to the dialog.
Now in the items selected method you need to dispose of the container
Private Sub NSSavePanel_ItemsSelected(obj as NSSavePanelGTO, items() as FolderItem)
'UpdateFileList(items)
'label1.Text = "Option 1: " + SaveAccessories1.Option1Value.ToString + _
'" Option 2: " + SaveAccessories1.Option2Value.ToString
mDialog = Nil
AccessoryPanel.Close ' close it out from the window
AccessoryPanel = Nil ' clear the property for next time.
End Sub
I forgot to add that you have to couple up a method for the FileTypeChanged event on the panel. I’ve made all those changes to my branch of the source and generated a pull request for review. I’m certainly open to improvements?