ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Core Namespace / Contents Class
Members Example

In This Topic
    Contents Class
    In This Topic
    IContentsProviders will return an instance of this class for their "contents". Contents are shown in the Contents Dock pane when the IContentsProvider is activated.
    Object Model
    Contents ClassOperationManager Class
    Syntax
    public class Contents 
    Public Class Contents 
    Remarks
    Typically:
    The ContentsView is your user control or "UI"
    The ContentsViewModel is the UI view model and should be your pane (it is usually also the IContentsProvider)
    The OperationManager is the operation manager you want to contain Undo/Redo operations when your content is active. For example: see the code snipped below. Your pane has been activated and is being asked to provide its Contents via IContentsProvider.Contents
    Example
    internal class MyCustomPaneViewModel : ViewStatePane, IContentsProvider, IContentsControl {
        ...
        private Contents _contents;
        
        public Contents Contents  {
           get {
          if (_contents == null) {
            
            //Instantiate your UI (probably a custom user control)
            FrameworkElement contentsControl = new MyCustomPaneContentsUserControl();
            contentsControl.DataContext = this;//set the View model to the data context (standard MVVM)
     
            //Make the ArcGIS.Desktop.Core.Contents control which is used
            //by the contents dockpane to show your pane's content
            _contents = new Contents();
            _contents.ContentsView = contentsControl;//Your UI
            _contents.ContentsViewModel = this;//used for IContentsControl, IContentsPaneClipboardOps and INotifyPropertyChanged
            _contents.OperationManager = this.OperationManager;//Your operations manager
         }
         return _contents;
       }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Core.Contents

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also