Contributing User Interface from a lazy addin
- Last UpdatedNov 27, 2026
- 1 minute read
User Interface Customization (UIC) files are parsed eagerly at start-up, but a lazy addin's commands and controls are registered only when it starts (later). Common Application Framework (CAF) bridges this automatically through deferred or sticky registration:
-
ICommandManager.Commands.CommandAdded – a User Interface (UI) tool bound to a command that is not registered yet is hidden. When the command is later added to the command manager, the tool is bound to it and becomes visible.
-
ICommandBarManager.ControlAdded - container tools (ContainerTool, TaskPaneTool, PopupControlContainerTool) referencing a lazy addin's control bind when the control arrives.
-
Contextual ribbon tab groups bound to a command that is not registered yet are kept in sync automatically: visibility is applied when the command is registered and follows later changes to Command.Visible (Command.VisibleChanged).
The following guidance is provided:
-
You generally do not need to do anything special. Register commands or controls normally in Start() and CAF will connect them to the pre-loaded UIC.
-
If your addin toggles command visibility or state, drive it through the Command object (its Visible or Checked), which propagates to the bound UI even when the binding was deferred.
-
When posting work to the UI thread from deferred or idle callbacks, use CAF's captured UI context (ApplicationFrameworkApplication.UISyncContext). Do not use SynchronizationContext.Current, which in the native-hosted AVEVA modules can dispatch to a ThreadPool thread and violate WinForms thread affinity.