ArcGISWindowsPhoneSDK.LoadWebMapWithBing.LoadMapButton_Click C# (CSharp) Метод

LoadMapButton_Click() приватный Метод

private LoadMapButton_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
Результат void
        private void LoadMapButton_Click(object sender, RoutedEventArgs e)
        {
            WebClient webClient = new WebClient();
            string uri = string.Format("http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?supressStatus=true&key={0}", BingKeyTextBox.Text);

            webClient.OpenReadCompleted += (s, a) =>
            {
                if (a.Error == null)
                {
                    DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(BingAuthentication));
                    BingAuthentication bingAuthentication = serializer.ReadObject(a.Result) as BingAuthentication;
                    a.Result.Close();

                    if (bingAuthentication.authenticationResultCode == "ValidCredentials")
                    {
                        Document webMap = new Document();
                        webMap.BingToken = BingKeyTextBox.Text;
                        webMap.GetMapCompleted += webMap_GetMapCompleted;

                        webMap.GetMapAsync("75e222ec54b244a5b73aeef40ce76adc");

                        BingKeyGrid.Visibility = System.Windows.Visibility.Collapsed;
                        InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Collapsed;
                    }
                    else InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Visible;
                }
                else InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Visible;
            };

            webClient.OpenReadAsync(new System.Uri(uri));
        }