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 6853765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:33:02+00:00 2026-05-27T01:33:02+00:00

Here is my problem: I am creating a WP7 application and need to list

  • 0

Here is my problem: I am creating a WP7 application and need to list all contacts on the mobile device. I know there is the Contacts class with method SearchAsync and SearchCompleted event handler.

This is all working except for one detail; when I am using the application on my phone, the search takes more than 12 seconds! I am using data virtualization to make the UI draw quickly. I have about 400 contacts in my phone. So the problem is, that SearchCompleted is fired after a long time 🙁

Do you have any ideas how to improve this solution? Should I start inserting contacts in listbox by first letter (“a”, “b”… but then that means I need to call SearchAsync repeatedly) and then how can I merge it?

Device: Samsung Omnia 7

ThreadPool.QueueUserWorkItem(result =>
{
     _cachingRunning = true;
     var contacts = new Contacts();
     contacts.SearchCompleted += contacts_SearchCompleted;
     contacts.SearchAsync(string.Empty, FilterKind.None, null);
});

This method is called almost 12 second after SearchAsync:

private void contacts_SearchCompleted(object sender, ContactsSearchEventArgs e)
{
            _phoneContacts = e.Results;
            Count = e.Results.Count();      

            Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    Cached = true;
                    _cachingRunning = false;
                    CachingChanged();
            });
 }

I store _phoneContacts and then use it for filtering; accessing it by Index and Count during data virtualization on ListBox.

This method “works” with VirtualizingDataCollection (Telerik) and creates ViewModel item which is added to VirtualizingDataCollection.

public ObservableCollection<ExtendedContactModel> GetContactsRange(int startIndex, int count)
        {
            var collection = new ObservableCollection<ExtendedContactModel>();

            for (var i = startIndex; i < startIndex + count; i++)
            {
                var vo = ConvertToVO(_phoneContacts.ElementAt(i));
                var newContact = ConvertToExtendedContactModel(_phoneContacts.ElementAt(i), vo);

                collection.Add(newContact);
            }
            return collection;
        }
  • 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-05-27T01:33:02+00:00Added an answer on May 27, 2026 at 1:33 am

    If this is a Mango device you have a couple of options:

    1)Use a background task to push contact information into an application-specific data store. The standard background task runs every 30 minutes and is allowed to take about 30 seconds to execute. More info on the background agent can be found here: Background Agents

    2)If the background agent is too scary you can do all this in-process. When the user opens the app up a background thread can gather the contacts list and save them to an internal store.

    While you’d need to spend time managing the internal store of contacts, it allows you to control the contact list and will definitely improve the user experience as they’ll think the contact search is very fast.

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

Sidebar

Related Questions

I am having some serious problem here. When do we need a class exactly?
Here's my problem: I am creating a Blackberry application that access's my data via
Okay, so here's my problem: We use FOP for creating pretty report output. We
Okay, so, here's what the problem is. I'm creating a flash site with each
I'm having a strange problem here... I have an ASP.NET 3.5 application that has
I have a problem creating authentication part for my application. Below is the simplified
got a problem here. Hope you can help :D The software I'm creating manage
We have a problem here. We need to translate a website into multiple language.
I have a problem here. I'm creating UILabels dynamically to be displayed into a
I have created a BinaryTreeNode<T> class and then creating Add(T data) method for BinaryTree<T>

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.