You can use system variable “LAYERMANAGERSTATE” to identify the state of the Layer property manager. LAYERMANAGERSTATE is ready only system variable and indicates below states of the window
[CommandMethod("LayerDlgState")]
static public void LayerDlgState()
{
short dlg =
(short)Application.GetSystemVariable("LAYERMANAGERSTATE");
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
if (dlg == 0)
{
ed.WriteMessage("Layer Palette is closed\n");
}
else if (dlg == 1)
{
ed.WriteMessage("Layer Palette is open\n");
}
}