AnsweredAssumed Answered

how to wait unitl layer creation is complete?

Question asked by andrarias on Jun 22, 2017
Latest reply on Jun 23, 2017 by andrarias

Hi, I am adding a layer to a map and want to read all the values from a particular field,


await QueuedTask.Run(() =>
                    Layer RefLayer = LayerFactory.CreateLayer(new Uri(LyrFile), myMap);
                    if (RefLayer == null)
                        ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Failed to create layer for url:" + LyrFile);


                       //find layer
                      var disLayer = MapView.Active.Map.FindLayers(layerName).FirstOrDefault() as BasicFeatureLayer;





however the FindLayers returns null.

What would be an appropriate way to wait until the creation is done?

Can someone help me solve this?