Click or drag to resize

Scene Constructor (Item)

Initializes a new instance of the Scene class with an ArcGIS Item.

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.11.0
public Scene(
	Item item


Type: Esri.ArcGISRuntime.PortalItem
The webscene item. Only PortalItem is supported.
The specified item must be of type WebScene or the scene will fail to load


Example Name: OpenScenePortalItem

Open a web scene from a portal item.

Code example screen shot.

// Copyright 2018 Esri.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific 
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Portal;
using System;
using System.Windows;

namespace ArcGISRuntime.WPF.Samples.OpenScenePortalItem
        name: "Open scene (portal item)",
        category: "Scene",
        description: "Open a web scene from a portal item.",
        instructions: "When the sample opens, it will automatically display the scene from ArcGIS Online. Pan and zoom to explore the scene.",
        tags: new[] { "portal", "scene", "web scene" })]
    public partial class OpenScenePortalItem
        // Hold the ID of the portal item, which is a web scene.
        private const string ItemId = "31874da8a16d45bfbc1273422f772270";

        public OpenScenePortalItem()

            // Create the UI, setup the control references and execute initialization.

        private async void Initialize()
                // Try to load the default portal, which will be ArcGIS Online.
                ArcGISPortal portal = await ArcGISPortal.CreateAsync();

                // Create the portal item.
                PortalItem websceneItem = await PortalItem.CreateAsync(portal, ItemId);

                // Create and show the scene.
                MySceneView.Scene = new Scene(websceneItem);
            catch (Exception e)
                MessageBox.Show(e.ToString(), "Error");
        <esri:SceneView x:Name="MySceneView" />
See Also
Additional Examples
Hyperlink to ExampleDescription
OpenScenePortalItemOpen a web scene from a portal item.
ViewContentBeneathSurfaceSee through terrain in a scene and move the camera underground.