Gets or sets the group caption, used to group GalleryItems under headings within the Gallery.

Namespace:  ESRI.ArcGISExplorer.Application

Assembly:  ESRI.ArcGISExplorer.Application (in ESRI.ArcGISExplorer.Application.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public string GroupCaption { get; set; }
Visual Basic (Declaration)
Public Property GroupCaption As String

Field Value

A string representing the caption of the group in which this GalleryItem is shown.

Remarks

Group captions are used to divide GalleryItems under headings, and are most suited for use in galleries with a large amount of items, or galleries with obvious categories of items. For example, the Symbols gallery on the Appearance tab in the Ribbon shows categories of marker symbols such as Civic and Pushpin, and categories of fill symbols such as Outline and Solid.

Examples

The code below demonstrates the use of the GroupCaption property on GalleryItem, by adding a GalleryItem for each icon installed with this SDK, and categorizing them into either 32 by 32 pixel icons, 16 by 16 pixel icons, or composite images (image files with multiple icons for extraction). When used in a Gallery, this code also demonstrates how images of different shapes and sizes are scaled to the size specified in the imageSize attribute of the Gallery element in the AddIns.xml declaration of the Gallery.
CopyC#
// Read in images from the icons installed with the SDK to use as icons.
string imgPath = Environment.GetEnvironmentVariable("ArcGIS_E3SDK");

// Get a list of all the images.
string[] files = System.IO.Directory.GetFiles(imgPath + @"\Icons", "*.png");
foreach (string fileName in files)
{
  // Create an Image from each file.
  Image img = Image.FromFile(fileName);
  // Get the file name to use as a Caption.
  string file = System.IO.Path.GetFileNameWithoutExtension(fileName);
  GalleryItem gi = new GalleryItem(file, img);

  // Categorize the images and place GalleryItems into groups.
  if (fileName.EndsWith("32.png"))
  {
    gi.GroupCaption = "32 x 32 pixel icons";
  }
  else if (fileName.EndsWith("16.png"))
  {
    gi.GroupCaption = "16 x 16 pixel icons";
  }
  else
  {
    gi.GroupCaption = "Composite Images";
  }

  // Add the GalleryItem to the Items property.
  this.Items.Add(gi);
CopyVB.NET
' Read in images from the icons installed with the SDK to use as icons.
Dim imgPath As String = Environment.GetEnvironmentVariable("ArcGIS_E3SDK")

' Get a list of all the images.
Dim files As String() = System.IO.Directory.GetFiles(imgPath & "\Icons", "*.png")
For Each fileName As String In files
  ' Create an Image from each file.
  Dim img As Image = Image.FromFile(fileName)
  ' Get the file name to use as a Caption.
  Dim file As String = System.IO.Path.GetFileNameWithoutExtension(fileName)
  Dim gi As GalleryItem = New GalleryItem(file, img)

  ' Categorize the images and place GalleryItems into groups.
  If (fileName.EndsWith("32.png")) Then
    gi.GroupCaption = "32 x 32 pixel icons"
  ElseIf (fileName.EndsWith("16.png")) Then
    gi.GroupCaption = "16 x 16 pixel icons"
  Else
    gi.GroupCaption = "Composite Images"
  End If

  ' Add the GalleryItem to the Items property.
  Me.Items.Add(gi)
Next fileName

See Also