Solved! Go to Solution.
If TypeOf My.ArcMap.Document.ActiveView Is IMap Then ' document is in Data view ElseIf TypeOf My.ArcMap.Document.ActiveView Is IPageLayout Then ' document is in Layout view End If
Public ReadOnly Property Enabled() As Boolean Implements ESRI.ArcGIS.SystemUI.ICommand.Enabled Get Dim mxDocument As IMxDocument = DirectCast(m_application.Document, IMxDocument) ' Enabled as long as the document is in Data view. Return (TypeOf mxDocument.ActiveView Is IMap) End Get End Property
Dim pMap As IMap = My.ArcMap.Document.ActiveView
If TypeOf My.ArcMap.Document.ActiveView Is IMap Then ' document is in Data view ElseIf TypeOf My.ArcMap.Document.ActiveView Is IPageLayout Then ' document is in Layout view End If
Public ReadOnly Property Enabled() As Boolean Implements ESRI.ArcGIS.SystemUI.ICommand.Enabled Get Dim mxDocument As IMxDocument = DirectCast(m_application.Document, IMxDocument) ' Enabled as long as the document is in Data view. Return (TypeOf mxDocument.ActiveView Is IMap) End Get End Property