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

  • SEARCH
  • Home
  • 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 1049409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:36:43+00:00 2026-05-16T16:36:43+00:00

I have a SL application that reads some data from the database, which I

  • 0

I have a SL application that reads some data from the database, which I do through a WCF Service. I was having some delay problems due to this access, so I solved it by loading all the data into a dictionary in my app. Now I want to make sure the application will only be displayed after I loaded all this information, how can I do that? I thought that just puting my InitializeComponents after the data load would be enough, but it is not. Here is some piece of my code:

 public Brasil()
 {
     //InitializeComponent();
     webService = new DataRetrieverReference.DataRetrieverClient();
     webService.GetCounterCompleted += new EventHandler<WebPortos.DataRetrieverReference.GetCounterCompletedEventArgs>(webService_GetCounterCompleted);
     webService.GetCounterAsync();
     webService.GetDataCompleted += new EventHandler<DataRetrieverReference.GetDataCompletedEventArgs>(webService_GetDataCompleted);

 }

 void webService_GetCounterCompleted(object sender, WebPortos.DataRetrieverReference.GetCounterCompletedEventArgs e)
 {
     int counter = e.Result;
     this.dictionary = new Dictionary<int, WebPortos.DataRetrieverReference.vwPortos_SEP>();

     for (int i = 0; i < counter; i++)
     {
         webService.GetDataAsync(i);
     }

     InitializeComponent();
 }

As you can see, I put it inside my data loading method, but it didn’t work. Any tips?

  • 1 1 Answer
  • 3 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-05-16T16:36:44+00:00Added an answer on May 16, 2026 at 4:36 pm

    It is bad practice to delay the creation of views in any way. Leave InitializeComponent in the constructor! 🙂

    What you want to do is simply hide your display until the data is ready. Easiest way (to keep this example simple) is start with Visibility set to collapsed on some parent element on the page, then set that to Visible again after the data is loaded.

    Real world solutions involve using busy indicators to stop interaction with specific areas/controls while the data loads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read from some article that say's Apple doesn't approve the application which
I have developed an application that reads files from the folder chosen by the
I have an iPhone application that reads RSS feeds from a YouTube channel. However,
I have a Silverlight application that reads its content from an XML file. The
I have an service application that reads a config file containing a list of
I have to write a C++ application that reads from the serial port byte
I have an application that imports data read from text files from a directory
I am building application that required some data from iPhone's Call log(read only). The
So I have a web application that serves some data...lets say if I query
I have a windows forms application that reads and updates an XML file with

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.