private Task ApplyLabelFeatureLayerAsync()
        {
            return(QueuedTask.Run(() =>
            {
                //Get the layer's definition
                var lyrDefn = SelectedLayer.GetDefinition() as CIMFeatureLayer;
                //Get the label classes - we need the first one
                var listLabelClasses = lyrDefn.LabelClasses.ToList();
                var theLabelClass = listLabelClasses.FirstOrDefault();
                //Place all labels horizontally
                theLabelClass.StandardLabelPlacementProperties.LineLabelPosition.Horizontal = true;
                //Set the label classes' symbol to the custom text symbol
                theLabelClass.TextSymbol.Symbol = SelectedTextStyle.Symbol;
                lyrDefn.LabelClasses = listLabelClasses.ToArray(); //Set the labelClasses back
                SelectedLayer.SetDefinition(lyrDefn);

                //set the label's visiblity
                if (IsLabelVisible)
                {
                    (SelectedLayer as FeatureLayer).SetLabelVisibility(true);
                }
            }));
        }