protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string value; string type; NavigationContext.QueryString.TryGetValue("type", out type); NavigationContext.QueryString.TryGetValue("value", out value); UsZip.USZipSoapClient c = new UsZip.USZipSoapClient(); USZipSoapClient u = new USZipSoapClient(); switch(type){ case "Zip": u.GetInfoByZIPAsync(value); u.GetInfoByZIPCompleted += new EventHandler<GetInfoByZIPCompletedEventArgs>(u_GetInfoByZIPCompleted); break; case "Area": u.GetInfoByAreaCodeAsync(value); u.GetInfoByAreaCodeCompleted += new EventHandler<GetInfoByAreaCodeCompletedEventArgs>(u_GetInfoByAreaCodeCompleted); break; case "City": u.GetInfoByCityAsync(value); u.GetInfoByCityCompleted += new EventHandler<GetInfoByCityCompletedEventArgs>(u_GetInfoByCityCompleted); break; case "State": u.GetInfoByStateAsync(value); u.GetInfoByStateCompleted += new EventHandler<GetInfoByStateCompletedEventArgs>(u_GetInfoByStateCompleted); break; } }