예제 #1
0
        partial void btnOk_TouchUpInside(UIButton sender)
        {
            btnOk.Enabled     = false;
            btnCancel.Enabled = false;
            txtBingMapKey.EndEditing(true);

            string bingMapKey = txtBingMapKey.Text;

            Task.Factory.StartNew(() =>
            {
                bool isValid = ValidateBingMapKey(bingMapKey, ThinkGeo.MapSuite.iOS.BingMapsMapType.Aerial);
                iOSMap.BeginInvokeOnMainThread(() =>
                {
                    if (isValid)
                    {
                        ((BingMapsOverlay)iOSMap.Overlays["BingMapsAerialOverlay"]).ApplicationId = bingMapKey;
                        ((BingMapsOverlay)iOSMap.Overlays["BingMapsRoadOverlay"]).ApplicationId   = bingMapKey;

                        iOSMap.Overlays["OpenStreetMapOverlay"].IsVisible  = false;
                        iOSMap.Overlays["BingMapsAerialOverlay"].IsVisible = Global.BaseMapType == BaseMapType.BingMapsAerial;
                        iOSMap.Overlays["BingMapsRoadOverlay"].IsVisible   = Global.BaseMapType == BaseMapType.BingMapsRoad;
                        iOSMap.Refresh();

                        alertViewShadow.Hidden     = true;
                        bingMapKeyAlertView.Hidden = true;
                    }
                    else
                    {
                        lblBingMapKeyMessage.Text = "The input BingMapKey is not validate.";
                    }
                    btnOk.Enabled     = true;
                    btnCancel.Enabled = true;
                });
            });
        }