Parameters
- color
- The color to display the layers selection.
- fillColor
- The color to display the layers selected polygon interiors.
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
If the layer is not a polygon layer, the fillColor is ignored.
Specify a null color to indicate that the layer should display its selection in the default selection color defined here ArcGIS.Desktop.Core.SelectionOptions.SelectionColor. Specify a null fillColor to indicate that the layer should dsiplay it's interior fill in the default selection fill color defined here ArcGIS.Desktop.Core.SelectionOptions.SelectionFillColor.
Polygon interiors display a selection only if ArcGIS.Desktop.Core.SelectionOptions.UseSelectionFill is true. That is if ArcGIS.Desktop.Core.SelectionOptions.SelectionFillColor is non-null. The fillColor will be displayed for selected polygon interiors only if the layers selection is displayed in a solid fill; that is ArcGIS.Desktop.Core.SelectionOptions.IsSelectionFillHatched is false, otherwise the layers selection color will be used in the hatched fill.
{
await QueuedTask.Run(() =>
{
if (featureLayer.SupportsCustomSelectionProperties())
{
// get the set of properties
var (useCustomSelectioncolur, customSelectionColor, usecustomSelectioinFilleColor, customSelectionFillColor) = featureLayer.GetCustomSelectionProperties();
// set the layer to use a specific color
featureLayer.SetCustomSelectionColor(ColorFactory.Instance.RedRGB);
// or set a specific color AND fill color
featureLayer.SetCustomSelectionColor(ColorFactory.Instance.RedRGB, ColorFactory.Instance.BlueRGB);
// reset to use the default selection color
featureLayer.SetUseDefaultSelectionColor();
}
if (!featureLayer.IsVisible)
{
featureLayer.SetVisibility(true);
}
//Do a selection
mapView.SelectFeatures(mapView.Extent);
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)