Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7968079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:01:14+00:00 2026-06-04T07:01:14+00:00

In my windows phone application I am using singleton classes for sending and receiving

  • 0

In my windows phone application I am using singleton classes for sending and receiving web request and response. So in my current implementation I will call the web request from viewmodel along with an Action<> delegate. For retrieving error call back and it is working fine for me. My issue is that when I fast app switch the application, the web request cancels and it returns a web error. I need to get this web exception in my view model. How can I get this response by using the Func<> delegate? Please anyone help me to solve this issue.

// viewmodel code
private void Login()
{
    LoginContoller.Instance.Login(userName, password, ErrorCallbackCompleted);
}
//callback
private void ErrorCallbackCompleted()
{

}

// code inside singleton class
public static Action ErrorCallbackResponse;

public void Login (string userName, string password, Action errorCallback)
{
    ErrorCallbackResponse = errorCallback;
}

// This method will be invoked from the error callback of web request class
public void GetErrorCallBack(Exception ex) 
{
    ErrorCallbackResponse();
    //I need to pass this ex object to  my viewmodel using Func<>
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:01:15+00:00Added an answer on June 4, 2026 at 7:01 am
    // viewmodel code
      private void Login()
      {
           LoginContoller.Instance.Login(userName, password, ErrorCallbackCompleted);
      }
    
     //callback
     public void ErrorCallbackCompleted(Exception exception)
     {
     }
    
    // code inside singleton class
    
      public static Action<Exception> ErrorCallbackResponse;
    
    public void Login (string userName, string password, Action<Exception> errorCallback)
    {
       ErrorCallbackResponse = errorCallback;
    }
    
    public void GetErrorCallBack(Exception ex) // This method will be invoked from the error callback of web request class
    {
        ErrorCallbackResponse(ex);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need Windows Phone application to upload files to a web server using the
I am working on a Windows phone 7 application. I am using this implementation
I have a Windows Phone 7 application (Silverlight-based) that sends a web request and
I'm using visual studio 2010 do developt my Windows phone application! I'm newbie and
I'm making a simple game using the Windows Phone Silverlight and XNA Application type
I'm building a windows phone 7 application using silverlight 4. I store my data
I am using Silverlight to develop a Windows Phone 7 application. My requirement is
I'm debugging a windows phone 7 application using Visual Studio, and I'm trying to
In my Windows Phone application I need to get hash using SHA-1 Algorithm. How
I have a windows phone 7 application where I´m using a DatePicker from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.