ArcGIS Pro 2.6 API Reference Guide
CanSetViewingMode Method
Example 

ArcGIS.Desktop.Mapping Namespace > MapView Class : CanSetViewingMode Method
Gets a value indicating if the view can be changed to the provided ArcGIS.Core.CIM.MapViewingMode.
Syntax
public bool CanSetViewingMode( 
   MapViewingMode viewingMode
)
Public Function CanSetViewingMode( _
   ByVal viewingMode As MapViewingMode _
) As Boolean

Parameters

viewingMode

Return Value

True if the map view can be set to the ArcGIS.Core.CIM.MapViewingMode, false if it cannot.
Remarks
Use this method to test if SetViewingModeAsync can complete successfully. For a 2D view the only supported viewing mode is Map. For a 3D view SceneLocal and SceneGlobal are valid viewing modes.
Example
Change the active map view's viewing mode to SceneLocal.
public void SetViewingModeToSceneLocal()
{
  //Get the active map view.
  var mapView = MapView.Active;
  if (mapView == null)
    return;

  //Check if the view can be set to SceneLocal and if it can set it.
  if (mapView.CanSetViewingMode(ArcGIS.Core.CIM.MapViewingMode.SceneLocal))
    mapView.SetViewingModeAsync(ArcGIS.Core.CIM.MapViewingMode.SceneLocal);
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

MapView Class
MapView Members