Dockable Window Template does not seem to work - Where is it.

555
1
01-16-2014 04:49 AM
RickeyTom
New Contributor II
I am using the new ArchMap .NET SDK (SDK_DotNet) that came with version 10.2.1 and VS 2012.

I create a project using ArcGIS/Desktop Add-ins/ArcMap Add-in
  Fill in the values on the welcome.
  For Add-In components, I (only) select Dockable Window.
  Click Finish and run.

I see the add-in is added to ArcMap but the dockable window does not appear anywhere.
It is not clear what I need to do to get it to display at this point. From what I gather from the documentation,
the wizard is supposed to automate this.

I can add buttons and they are visible in the customize (Mode) /Commands so I know the add-in works.

The following link describes creating a project with dockable windows in an older version of ESRI (10.0)

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000014w000000

But the wizard has changed for 10.2.1


If I create an empty project and then attempt to insert the add-in after, the project does not even compile.


I did get the simple logger console dockable window project to work, but I believe it is using the old style 10.0 pattern.

What am I doing wrong.

NOTE: I noticed that the created project targeted .NET 4.5. But I tried in in 3.5 and 4.0 and the results where the same.
Where is that dockable window.

I uploaded the project that the wizard generates.

Thanks
0 Kudos
1 Reply
ConorBarber1
New Contributor II
With IDockableWindow, there are two components: The windows form component, and the ESRI IDockableWindow object inside which the windows form is embedded.

First, you need to get an instantiation of your ESRI IDockableWindow:

public IDockableWindow get_Window(out IDockableWindow dockWindow)
        {
            UID dockWinID = new UIDClass();
            dockWinID.Value = ThisAddIn.IDs.DockableWindow1;

            dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
            dockWindow.Caption = "Dockable Window Caption Here";
           
            return dockWindow;
        }


Now let's say you want to show your dockable window when a button is clicked. Declare your dockable window and call the IDockableWindow.Show() method in your button OnClick event:

        public ShowDockableWindowButton()
        {
        }

        protected override void OnClick()
        {
            IDockableWindow dockWindow = get_Window(out dockWindow);      
            dockWindow.Show(true);
           
        }
0 Kudos