Show / Hide Table of Contents

Class Graphic

Instances of this class represent graphics. Graphics can be displayed on the map through a GraphicsOverlay. Graphics can be used as input to a task, or they can be used to display output from a task, or in response to user interaction.

Inheritance
Object
GeoElement
Graphic
Implements
System.ComponentModel.INotifyPropertyChanged
GeoElement.Attributes
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Object.ToString()
Namespace: Esri.ArcGISRuntime.UI
Assembly: Esri.ArcGISRuntime.dll
Syntax
public class Graphic : GeoElement, INotifyPropertyChanged
Remarks

Each graphic must contain a Geometry describing the location and the shape of the graphic.

A graphic can be associated with a Symbol which determines how the graphic looks. Alternatively, the GraphicsOverlay can be assigned a Renderer which determines the appearance of all graphics in the layer. Note, symbols associated with individual graphics take precedence over the symbols chosen by the renderer. The symbol used depends upon the geometry type associated with the graphic. A MarkerSymbol is used for MapPoint and Multipoint geometries, SimpleLineSymbol for Polyline geometries, and SimpleFillSymbol for Polygon geometries.

A graphic can contain a set of attributes (key-value pairs) providing more information about the graphic.

Constructors

Name Description
Graphic()

Initializes a new instance of the Graphic class.

Graphic(Geometry)

Initializes a new instance of the Graphic class and setting the geometry.

Graphic(Geometry, Symbol)

Initializes a new instance of the Graphic class and setting the geometry and symbol.

Graphic(Geometry, IEnumerable<KeyValuePair<String, Object>>)

Initializes a new instance of the Graphic class and setting the geometry.

Graphic(Geometry, IEnumerable<KeyValuePair<String, Object>>, Symbol)

Initializes a new instance of the Graphic class and setting the geometry, attributes and symbol.

Graphic(IEnumerable<KeyValuePair<String, Object>>)

Initializes a new instance of the Graphic class and setting the attributes.

Properties

Name Description
Geometry

Gets or sets the Geometry of this graphic.

GraphicsOverlay

Gets the GraphicsOverlay that this Graphic is attached to.

IsSelected

Gets or sets a value indicating whether this graphic is selected.

IsVisible

Gets or sets a value indicating whether this graphic is rendered on a map.

Symbol

Gets or sets the Symbol for this graphic.

ZIndex

Gets or sets the draw order for graphics. Graphics with higher Z-index values are drawn on top of lower Z-index graphics.

Name Description
INotifyPropertyChanged.PropertyChanged

Occurs when a property value changes.

Applies to

TargetVersions
.NET Standard 2.0100.3 - 100.15
.NET 6.0100.13 - 100.15
.NET 6.0 Windows100.13 - 100.15
.NET Framework100.0 - 100.15
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 100.15

Relevant samples

Add graphics with symbols: Use a symbol style to display a graphic on a graphics overlay.
Buffer: Create a buffer around a map point and display the results as a `Graphic`
In This Article
Back to top Copyright © 2022 Esri.