A custom Module has two opportunities to initialize itself: its class constructor and its Initialize method. The Framework calls both functions whenever a Module is loaded. Modules load either explicitly with FrameworkApplication.FindModule
or implicitly whenever any of their DAML elements (Panes, DockPanes, Controls, etc) are loaded. For example, when a DockPane or a Button on a Ribbon Tab is created, their parent module will automatically load if it hasn't already done so.
The Initialize method has the added benefit of returning whether the initialization was successful or not. If initialization fails, the Framework immediately calls Uninitialize
.
Target Platforms: Windows 10, Windows 8.1, Windows 7