ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / CanSetViewingMode Method
Example

In This Topic
    CanSetViewingMode Method
    In This Topic
    Gets a value indicating if the view can be changed to the provided ArcGIS.Core.CIM.MapViewingMode.
    Syntax
    Public Function CanSetViewingMode( _
       ByVal viewingMode As MapViewingMode _
    ) As Boolean
    public bool CanSetViewingMode( 
       MapViewingMode viewingMode
    )

    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
    Set ViewingMode
    {
      //Check if the view can be set to SceneLocal and if it can set it.
      var result = mapView.CanSetViewingMode(MapViewingMode.SceneLocal);
      if (result)
        mapView.SetViewingModeAsync(MapViewingMode.SceneLocal);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also