void ribbonPaletteSet_WorkspaceLoaded(object sender, EventArgs e) { Autodesk.AutoCAD.Ribbon.RibbonPaletteSet pset = (Autodesk.AutoCAD.Ribbon.RibbonPaletteSet)sender; Initialize(_applications.First(x => x is Ribbons.ICmdRibbonPane)); pset.WorkspaceLoaded -= ribbonPaletteSet_WorkspaceLoaded; }