Add Part Provider in Code

Set the part provider for the UIPartTree control.

  1. Open the code for the InventorDockableWindowDesign, and locate the constructors for your DockableWindow class.
  2. You use only the constructor that requires two parameters. Remove, or comment out the no parameter and single parameter constructors.
  3. Modify the
     Inventor.DockingStateEnum parameter
    in the constructor by adding a default value for this parameter of
    default(Inventor.DockingStateEnum)
  4. When finished the function header looks like the following:
    public UIToolsDockableWindow(Inventor.ApplicationAddInSite addInSite, 
                Inventor.DockingStateEnum initialDockingState = default(Inventor.DockingStateEnum))
    
  5. Specify a location for the window, or accept the default position.
  6. Assign the PartProvider for the UIPartTree to the IntentUIProject. In the constructor, below the line where we call InitializeComponent(), add the following:
    uiPartTree1.PartProvider = intentUIProject1;
The wiring up of controls to the IntentUIProject is finished.