I've created a new add-in using WPF and dockable panel, panel load event name?

I've created a new add-in using WPF and dockable panel, panel load event name?

ahmed.elhawary73
Advocate Advocate
131 Views
1 Reply
Message 1 of 2

I've created a new add-in using WPF and dockable panel, panel load event name?

ahmed.elhawary73
Advocate
Advocate

I've created a new add-in using WPF and dockable panel, what event is triggered every time when i load this panel

0 Likes
132 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

I asked Gemini AI. It provided several incorrect answers, which I check against the Revit API documentation and refuted. In the end, it came up with the following:

   

Given the absence of a dedicated Revit API event or property, the most reliable and practical solution is to rely solely on the WPF Loaded event of your user control within the dockable pane.

  1. Register Your Dockable Pane:

    • As before, implement IDockablePaneProvider and register your pane using UIApplication.RegisterDockablePane().
  2. WPF User Control Loaded Event:

    • Inside your WPF user control, subscribe to the Loaded event.
    • This event will fire when the user control is loaded and rendered within the Revit UI, effectively indicating that the dockable pane is visible.
  3. Initialization:

    • Perform all necessary initialization tasks within the Loaded event handler.

   

Since that is no longer Revit API, I cannot directly check the validity. Please check yourself and let us know whether it helps. Thank you!

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes