Click or drag to resize
Graphic Class
Instances of this class represent graphics. Graphics can be displayed on the map through a GraphicsLayer. 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 Hierarchy

Namespace: Esri.ArcGISRuntime.Layers
Assembly: Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 10.2.7.0 (10.2.7.1234)
Syntax
public class Graphic : Feature

The Graphic type exposes the following members.

Constructors
  NameDescription
Public methodGraphic
Initializes a new instance of the Graphic class
Public methodGraphic(IEnumerableKeyValuePairString, Object)
Initializes a new instance of the Graphic class and setting the attributes.
Public methodGraphic(Geometry)
Initializes a new instance of the Graphic class and setting the geometry.
Public methodGraphic(Geometry, Symbol)
Initializes a new instance of the Graphic class and setting the geometry and symbol.
Public methodGraphic(Geometry, IEnumerableKeyValuePairString, Object)
Initializes a new instance of the Graphic class and setting the geometry.
Public methodGraphic(Geometry, IEnumerableKeyValuePairString, Object, Symbol)
Initializes a new instance of the Graphic class and setting the geometry, attributes and symbol.
Top
Methods
  NameDescription
Public methodCopyFrom
Updates the specified attributes.
(Inherited from Feature.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberFromJson
Creates a new instance of a Graphic class from json
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToJson
Creates a json string representation of this object.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyAttributes
Gets the attributes for the Graphic.
(Overrides FeatureAttributes.)
Public propertyGeometry
Gets or sets the geometry.
(Inherited from Feature.)
Public propertyIsSelected
Gets or sets whether this graphic is selected.
Public propertyIsVisible
Gets or sets whether this graphic is rendered on a map.
Public propertySymbol
Gets or sets the symbol for the graphic.
Public propertyZIndex
Gets or sets the Z index this graphic is rendered at within the GraphicsLayer it belongs to.
Top
Remarks

Each graphic must contain an Esri.ArcGISRuntime.Geometry describing the location and the shape of the graphic.

A graphic can be associated with an Symbol which determines how the graphic looks. Alternatively, the graphics layer can be assigned an 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.

See Also
Supported Platforms
This type is supported on the following ArcGIS Runtime .NET SDK platforms:
Windows Desktop
Windows Phone
Windows Store
Additional Examples
Hyperlink to ExampleDescription
Camera_SetMethodsDemonstrates navigating/animating between MapPoint Graphics with a Camera. Simultaneous changes of X, Y, Z, Pitch, and Heading during the animation is shown.
Editor_SketchingDemonstrates sketching various geometric shapes on the map via the Editor.RequestShapeAsync method. The sketches are then added as Graphics in a GraphicsLayer and drawn on the map.
EditorConfigurationDemonstrates sketching Polyline shapes on the map via the Editor.RequestShapeAsync method. The sketches are then added as Graphics in a GraphicsLayer and drawn on the map. Multiple versions of customizing the symbology of the Editor are shown.
EqualGeometriesDemonstrates the differences in comparing a few polygon geometries to via the Geometry.IsEqual and GeometryEngine.Equals Methods.
FindTaskDemonstrates using the Query.FindTask operation to search for text in attribute fields of an ArcGIS Server map service and display the features found as graphics in a GraphicsLayer.
GeocodeFullAddressInputDemonstrates performing a geocode by submitting values for multiple address fields.
GeocodeSingleLineInputPerforms a single line geocode using either an online ArcGIS Locator service or a local Locator.
GeometryEngine_BufferWithUnionDemonstrates using the powerful GeometryEngine local process to generate a single graphic buffer (unioned) based upon multiple points provided by user interaction with the map.
GeometryEngine_ConvexHullDemonstrates using the powerful GeometryEngine local process to generate a convex hull graphic polygon based upon user specified mouse-clicks/taps on the map.
GeometryEngine_Difference_Intersection_UnionDemonstrates using the powerful GeometryEngine local process to perform the spatial analysis operations of Difference, Intersection, and Union on two input geometries.
GeometryEngine_TestingSpatialRelationshipsDemonstrates using the powerful GeometryEngine local process to test various spatial relationships (Contains, Crosses, Disjoint, Equals, Intersects, Overlaps, Touches, Within) between two input geometries.
GetAreaAllows the user to draw a polygon on the map and calculate the area via several methods.
GraphicsLayer_LabelingDemonstrates labeling city names where two AttributeLabelClass'es are used (one for smaller cities and one for larger ones).
GraphicsLayer_RenderingModeDemonstrates setting the various GraphicsLayer.RenderingMode options and their effect on TextSymbols when the MapView is rotated.
GraphicsLayerWindowDemonstrates various Graphics and GraphicsLayer related actions.
GraphicsOverlayDemonstrates using the Query.FindTask operation to return county features in an ArcGIS Server map service and display the features found as Graphics in a GraphicsOverlay. The user can perform a MapViewTapped on the Graphics to perform a GraphicsOverlay.HitTestAsync to select features and display attribute information.
IdentifyParameter_DynamicLayerInfosDemonstrates performing an Identify on a Dynamic Layer using the ESRI.ArcGISRuntime.Tasks.Query.IdentifyParameter.DynamicLayerInfos Property.
IdentifyTaskDemonstrates using the Query.IdentifyTask operation find a feature based upon it's geographic position in an ArcGIS Server map service and display it as a graphic in a GraphicsLayer.
PolygonBuilder_MakeIslandsShows how to use the PolygonBuilder to turn multiple independent Polygons into a single Polygon (use case: grouping island Polygons together into one record).
PolygonFromScratchDemonstrates creating a simple polygon, donut polygon, and multiple ring polygon via code-behind. An option to view coordinate information for each vertex in the polygons is provided.
RoutingPointToPointDemonstrates simple point to point routing between two input locations.
RoutingWithBarriersShows routing and re-routing around user defined point, polyline, and polygon barriers.
RoutingWithDirectionsInteraction logic for RoutingWithDirections.xaml
SmoothGraphicAnimationAnimates a graphic smoothly between two user defined locations by calling the MapPoint.MoveTo method at regular intervals as defined by a DispatcherTimer. The distance the point is moved each time is calculated by a quintic easing function.