ArcGISPortalViewer.ViewModel.MapViewModel.SetViewAsync C# (CSharp) Method

SetViewAsync() private method

Sets the view on the extent of passed geometry while considering if side panel is opened.
private SetViewAsync ( Esri boundingGeometry, double margin = 20 ) : Task
boundingGeometry Esri
margin double
return Task
        private Task SetViewAsync(Esri.ArcGISRuntime.Geometry.Geometry boundingGeometry, double margin = 20)
        {
            if (Controller == null || boundingGeometry == null)
                return Task.FromResult(false);
            var extent = boundingGeometry.Extent;
            // set the padding around the extent - if the side pane is open add its width to the left margin
            Thickness padding = new Thickness((IsSidePaneOpen ? _collapsibleTabWidth : 0) + margin, margin, margin, margin);
            return Controller.SetViewAsync(extent, padding);
        }