ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Catalog Namespace / SaveItemDialog Class / ShowDialog Method
Example

In This Topic
    ShowDialog Method (SaveItemDialog)
    In This Topic
    Displays the Browse dialog box to identify the location and name of an item that will be saved to the active portal or to a local or network disk.
    Syntax
    Public Overrides NotOverridable Function ShowDialog() As Nullable(Of Boolean)
    public override Nullable<bool> ShowDialog()

    Return Value

    A boolean indicating if the Browse dialog was dismissed by pressing OK or Cancel.
    Remarks
    You can either configure the Browse dialog box properties first then display it with the ShowDialog method, or display the dialog box and then set its properties.
    Example
    Show OpenItemDialog
    {
      OpenItemDialog addToProjectDialog = new()
      {
        Title = "Add To Project",
        InitialLocation = @"C:\Data\NewYork\Counties\Maps",
        MultiSelect = true,
        Filter = ItemFilters.Composite_Maps_Import
      };
    
      bool? ok = addToProjectDialog.ShowDialog();
    
      if (ok == true)
      {
        IEnumerable<Item> selectedItems = addToProjectDialog.Items;
        foreach (Item selectedItem in selectedItems)
          MapFactory.Instance.CreateMapFromItem(selectedItem);
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also