private void OnMapReady()
        {
            // Waits a bit for the map to be ready.
            System.Threading.Tasks.Task.Delay(250).Wait();

            // The map is now ready.
            _isMapReady = true;

            // Initializes the map item controls.
            BindMapItemsControlItemsSource("ThingsPushpins", ViewModel.ThingGroups);
            BindMapItemsControlItemsSource("ZoneLabelsPushpins", ViewModel.Zones);

            // Applies a map view request that was issued before the map was ready.
            if (_delayedMapViewRequest != null)
            {
                SetMapView(_delayedMapViewRequest);

                _delayedMapViewRequest = null;
            }
        }
 private void OnViewModelMapViewRequested(object sender, GameMapViewModel.MapViewRequestedEventArgs e)
 {
     if (_isMapReady)
     {
         SetMapView(e);
     }
     else
     {
         // Delays this request for after the map is ready.
         _delayedMapViewRequest = e;
     }
 }