こんにちは、私は Windows Phone 開発の初心者です。コードを書いているときに少しぎこちないことをしているかもしれません。
button_click()
{
this.NavigationService.Navigate(new Uri("/HttpHandler.xaml", UriKind.Relative));
WebHandler.Make_url_HandleResponse("someurl", 1);
}
/*In HttpHandler Class having object Webhandler in previous class*/
public void Make_url_HandleResponse(string Uri, int req_id)
{
try
{
uri = new Uri(Uri);
}
catch (Exception exception)
{
Debug.WriteLine(exception.Message);
MessageBox.Show(exception.Message);
}
request = (HttpWebRequest)HttpWebRequest.Create(uri.AbsoluteUri);
Debug.WriteLine("The url is" + uri);
}
public void request_CallBack(IAsyncResult result)
{
try
{
//var request = (HttpWebRequest) result.AsyncState;
Stream stream;
string ext_str;
char[] separator = { '/' };
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(result);
using (stream = response.GetResponseStream())
{
/* here I want to navigate to a new page*/
Deployment.Current.Dispatcher.BeginInvoke(delegate()
{
try
{
downloadingProgress.IsIndeterminate = false;
downloadingProgress.Visibility = Visibility.Collapsed;
stkDownloading.Visibility = Visibility.Collapsed;
this.NavigationService.Navigate(new Uri("/NewUser.xaml",UriKind.Relative));
}
catch (Exception e)
{ }
});
}
httphandlerページから別のページに移動できるかどうかを尋ねようとしています。前もって感謝します