public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var legend = _allLayers[position];

            if (convertView == null)
            {
                convertView = new LegendItemView(_context);
            }

            (convertView as LegendItemView)?.Update(legend);
            return(convertView);
        }
            public override View GetView(int position, View convertView, ViewGroup parent)
            {
                var layerLegend = _layers[position];

                if (convertView == null)
                {
                    convertView = new LegendItemView(_context);
                }

                var tv = convertView as LegendItemView;

                if (tv != null)
                {
                    tv.Update(layerLegend);
                }

                return(convertView);
            }