The simple answer is: You can't.
The workaround is to create a point graphic on top of the polygon and use a TextMarkerSmbol for it.
Hey.Thanks for the reply and info.FYIHere is our implementation :In the Xaml (resources section), we created a controltemplate for the TextSymboland add a Graphics layer that will hold the custom graphics.
<Grid.Resources>
<esriSymbols:TextSymbol x:Name="LegendTextSymbol">
<esriSymbols:TextSymbol.ControlTemplate>
<ControlTemplate>
<Border Padding="10,5,10,5" Background="White" BorderBrush="Black">
<TextBlock
FontSize="{Binding Symbol.Size}"
Text="{Binding Symbol.Text}"
Foreground="Blue"
FontFamily="{Binding Symbol.FontFamily}"
HorizontalAlignment="Center" />
</Border>
</ControlTemplate>
</esriSymbols:TextSymbol.ControlTemplate>
</esriSymbols:TextSymbol>
</Grid.Resources>
...and then in the code behind, we hook up the UpdateCompleted event of the FeatureLayer: _featureLayer.UpdateCompleted += (sender, args) =>
{
_graphicsLayer.Graphics.Clear();
foreach (var graphic in _featureLayer.Graphics)
{
var textSymbol = new TextSymbol();
textSymbol.ControlTemplate = LegendTextSymbol.ControlTemplate;
textSymbol.Text = graphic.Attributes["NAME"] as string;
var textGraphic = new Graphic()
{
Geometry = new MapPoint(graphic.Geometry.Extent.XMax,
graphic.Geometry.Extent.YMax),
Symbol = textSymbol
};
_graphicsLayer.Graphics.Add(textGraphic);
}
};
Thanks.-Bjorn