Add two layers to the map as follows:
Add a multilateral row to the Graphics layer, but the Symbol attribute is not set for the multilateral row.
Symbol = "{StaticResource Symbol2 }"
<Esri: Map Background = "White">
<Esri: ArcGISTiledMapServiceLayer ID = "PhysicalTiledLayer"
Url = "http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer">
</Esri: ArcGISTiledMapServiceLayer>
<Esri: GraphicsLayer ID = "MyGraphics">
<Esri: GraphicsLayer. Graphics>
<Esri: Graphic>
<EsriGeometry: Polygon>
<EsriGeometry: Polygon. Rings>
<EsriGeometry: PointCollection>
<EsriGeometry: MapPoint X = "110.039" Y = "-20.303"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "132.539" Y = "-7.0137"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "153.281" Y = "-13.923"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "162.773" Y = "-35.174"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "133.594" Y = "-43.180"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "111.797" Y = "-36.032"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "110.039" Y = "-20.303"> </esriGeometry: MapPoint>
</EsriGeometry: PointCollection>
</EsriGeometry: Polygon. Rings>
</EsriGeometry: Polygon>
</Esri: Graphic>
</Esri: GraphicsLayer. Graphics>
</Esri: GraphicsLayer>
</Esri: Map>
In this case, we need to create a Symbol resource, which is slow in manual writing and prone to errors. Fortunately, Expression Blend provides us with convenience.
We establish the Symbol resources in a visualized manner. The final code is as follows:
<UserControl
Xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
Xmlns: d = "http://schemas.microsoft.com/expression/blend/2008"
Xmlns: mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"
Mc: Ignorable = "d"
Xmlns: esri = "clr-namespace: ESRI. ArcGIS. Client; assembly = ESRI. ArcGIS. Client"
Xmlns: esriSymbols = "clr-namespace: ESRI. ArcGIS. Client. Symbols; assembly = ESRI. ArcGIS. Client"
Xmlns: esriGeometry = "clr-namespace: ESRI. ArcGIS. Client. Geometry; assembly = ESRI. ArcGIS. Client"
X: Class = "ArcGISSLSDK_Graphics.UserControl1"
D: DesignWidth = "640" d: DesignHeight = "480">
<UserControl. Resources>
<EsriSymbols: FillSymbol x: Key = "F"> </esriSymbols: FillSymbol>
<EsriSymbols: FillSymbol x: Key = "Symbol1" BorderThickness = "2" Fill = "Red">
</EsriSymbols: FillSymbol>
<EsriSymbols: FillSymbol x: Key = "Symbol2" BorderThickness = "3" BorderBrush = "Red">
<EsriSymbols: FillSymbol. Fill>
<LinearGradientBrush EndPoint = "0.5, 1" StartPoint = "0.5, 0">
<GradientStop Color = "Black" Offset = "0"/>
<GradientStop Color = "# FFB3D65F" Offset = "1"/>
</LinearGradientBrush>
</EsriSymbols: FillSymbol. Fill>
</EsriSymbols: FillSymbol>
</UserControl. Resources>
<Grid x: Name = "LayoutRoot">
<Esri: Map Background = "White">
<Esri: ArcGISTiledMapServiceLayer ID = "PhysicalTiledLayer"
Url = "http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer">
</Esri: ArcGISTiledMapServiceLayer>
<Esri: GraphicsLayer ID = "MyGraphics">
<Esri: GraphicsLayer. Graphics>
<Esri: Graphic Symbol = "{StaticResource Symbol1}">
<EsriGeometry: MapPoint X = "-10.609" Y = "23.729"/>
</Esri: Graphic>
<Esri: Graphic Symbol = "{StaticResource Symbol2}">
<EsriGeometry: Polygon>
<EsriGeometry: Polygon. Rings>
<EsriGeometry: PointCollection>
<EsriGeometry: MapPoint X = "110.039" Y = "-20.303"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "132.539" Y = "-7.0137"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "153.281" Y = "-13.923"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "162.773" Y = "-35.174"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "133.594" Y = "-43.180"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "111.797" Y = "-36.032"> </esriGeometry: MapPoint>
<EsriGeometry: MapPoint X = "110.039" Y = "-20.303"> </esriGeometry: MapPoint>
</EsriGeometry: PointCollection>
</EsriGeometry: Polygon. Rings>
</EsriGeometry: Polygon>
</Esri: Graphic>
</Esri: GraphicsLayer. Graphics>
</Esri: GraphicsLayer>
</Esri: Map>
</Grid>
</UserControl>
The procedure is as follows: select the map control and find the attribute panel, for example:
Find the... following layers under Map Settings. The following dialog box is displayed:
Select GraphicsLayer. The following dialog box is displayed:
Click the dialog box after Graphics, and set it as a resource in the dialog box that appears.
The final running result is: