Select to view content in your preferred language

Changing selection color

1498
0
06-08-2016 02:47 PM
RiverTaig1
Occasional Contributor

I hope this is the right place to post this question.  I'm trying to change the selection color for a layer to red using the code below.  Although I am able to generate a selection, the color for the features ends up being the default color (cyan).

foreach (var x in MapView.Active.Map.Layers)

{

    if (x.Name == "Distribution Lines")

    {

        foreach (FeatureLayer fl in ((GroupLayer)x).Layers)

        {

            try

            {

                QueuedTask.Run(() =>

                {

                    CIMBasicFeatureLayer cbm = (CIMBasicFeatureLayer)fl.GetDefinition();

                    cbm.SelectionColor = CIMColor.CreateRGBColor(255, 0, 0);

                    fl.Select(queryFilter, SelectionCombinationMethod.New);

                                   

                });

            }

            catch (Exception ex)

            {

            }

        }

    }

}

0 Kudos
0 Replies