private async void Initialize()
        {
            // Apply an imagery basemap to the map.
            MyMapView.Map = new Map(Basemap.CreateDarkGrayCanvasVector());

            // Create the WMS Service.
            WmsService service = new WmsService(_wmsUrl);

            try
            {
                // Load the WMS Service.
                await service.LoadAsync();

                // Get the service info (metadata) from the service.
                WmsServiceInfo info = service.ServiceInfo;

                // Get the list of layer infos.
                foreach (var layerInfo in info.LayerInfos)
                {
                    LayerDisplayVM.BuildLayerInfoList(new LayerDisplayVM(layerInfo, null), _viewModelList);
                }

                // Update the map display based on the viewModel.
                UpdateMapDisplay(_viewModelList);

                // Update the list of layers.
                MyDisplayList.ItemsSource = _viewModelList;
            }
            catch (Exception e)
            {
                await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK");
            }
        }
        private async void Initialize()
        {
            // Apply an imagery basemap to the map
            _myMapView.Map = new Map(Basemap.CreateDarkGrayCanvasVector());

            // Create the WMS Service
            WmsService service = new WmsService(_wmsUrl);

            // Load the WMS Service
            await service.LoadAsync();

            // Get the service info (metadata) from the service.
            WmsServiceInfo info = service.ServiceInfo;

            // Get the list of layer infos.
            foreach (var layerInfo in info.LayerInfos)
            {
                LayerDisplayVM.BuildLayerInfoList(new LayerDisplayVM(layerInfo, null), _viewModelList);
            }

            // Create an array adapter for the layer display
            ArrayAdapter adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, _viewModelList);

            // Apply the adapter
            _myDisplayList.Adapter = adapter;

            // Subscribe to selection change notifications
            _myDisplayList.ItemClick += _myDisplayList_ItemClick;

            // Update the map display based on the viewModel
            UpdateMapDisplay(_viewModelList);
        }
        private async void Initialize()
        {
            // Show dark gray canvas basemap.
            _myMapView.Map = new Map(Basemap.CreateDarkGrayCanvasVector());

            // Create the WMS Service.
            WmsService service = new WmsService(_wmsUrl);

            // Load the WMS Service.
            await service.LoadAsync();

            // Get the service info (metadata) from the service.
            WmsServiceInfo info = service.ServiceInfo;

            List <LayerDisplayVM> viewModelList = new List <LayerDisplayVM>();

            // Get the list of layer infos.
            foreach (var layerInfo in info.LayerInfos)
            {
                LayerDisplayVM.BuildLayerInfoList(new LayerDisplayVM(layerInfo, null), viewModelList);
            }

            // Construct the layer list source.
            _layerListSource = new LayerListSource(viewModelList, this);

            // Set the source for the table view (layer list).
            _myDisplayList.Source = _layerListSource;

            // Force an update of the list display.
            _myDisplayList.ReloadData();
        }
        private async void Initialize()
        {
            // Apply an imagery basemap to the map
            _myMapView.Map = new Map(BasemapStyle.ArcGISDarkGray);

            // Create the WMS Service
            WmsService service = new WmsService(_wmsUrl);

            try
            {
                // Load the WMS Service
                await service.LoadAsync();

                // Get the service info (metadata) from the service.
                WmsServiceInfo info = service.ServiceInfo;

                // Get the list of layer infos.
                foreach (var layerInfo in info.LayerInfos)
                {
                    LayerDisplayVM.BuildLayerInfoList(new LayerDisplayVM(layerInfo, null), _viewModelList);
                }

                // Create an array adapter for the layer display
                ArrayAdapter adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, _viewModelList);

                // Apply the adapter
                _myDisplayList.Adapter = adapter;

                // Subscribe to selection change notifications
                _myDisplayList.ItemClick += _myDisplayList_ItemClick;

                // Update the map display based on the viewModel
                UpdateMapDisplay(_viewModelList);
            }
            catch (Exception e)
            {
                new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show();
            }
        }
        private async void Initialize()
        {
            // Show dark gray canvas basemap.
            _myMapView.Map = new Map(BasemapStyle.ArcGISDarkGray);

            // Create the WMS Service.
            WmsService service = new WmsService(_wmsUrl);

            try
            {
                // Load the WMS Service.
                await service.LoadAsync();

                // Get the service info (metadata) from the service.
                WmsServiceInfo info = service.ServiceInfo;

                List <LayerDisplayVM> viewModelList = new List <LayerDisplayVM>();

                // Get the list of layer infos.
                foreach (var layerInfo in info.LayerInfos)
                {
                    LayerDisplayVM.BuildLayerInfoList(new LayerDisplayVM(layerInfo, null), viewModelList);
                }

                // Construct the layer list source.
                _layerListSource = new LayerListSource(viewModelList, this);

                // Set the source for the table view (layer list).
                _layerList.Source = _layerListSource;

                // Force an update of the list display.
                _layerList.ReloadData();
            }
            catch (Exception e)
            {
                new UIAlertView("Error", e.ToString(), (IUIAlertViewDelegate)null, "OK", null).Show();
            }
        }