void labeledPolygon(ESRI.ArcGIS.Client.Geometry.Polygon inPolygon)
{
Graphic polygonGraphic = new Graphic();
SimpleFillSymbol fillSymbol = new SimpleFillSymbol()
{
BorderBrush = borderBrush,
Fill = fillBrush
};
polygonGraphic.Symbol = fillSymbol;
polygonGraphic.Geometry = inPolygon;
Envelope extentEnvelope = inPolygon.Extent;
MapPoint centerPoint = extentEnvelope.GetCenter();
Graphic textGraphic = new Graphic();
TextSymbol textSymbol = new TextSymbol()
{
//Text properties
};
textGraphic.Symbol = textSymbol;
textGraphic.Geometry = centerPoint;
//Add the two graphics to the map.
}