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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:13:51+00:00 2026-06-03T11:13:51+00:00

I have a TextBox that user can enter search-term in it. Its bind to

  • 0

I have a TextBox that user can enter search-term in it. Its bind to string Term property in my view-model. And I want to do a search query when its content changed. But I want to do the query in a separate thread with a delay.

e.g. when user type a letter, I want to wait for 0.3 second, and if user change the input within this time (0.3 second), the timer resets and starts again. Otherwise, I start a new thread and do the search query. While query is executing, if user change the term again, abort prev query and start again.

I know how to do this in windows-forms with threading and Timer class. But I’m new to WPF and I’m searching if there is a way specified for WPF threading functionality (or may be a way with a better performance).

Have you any idea? Can you help me?

  • 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-03T11:13:53+00:00Added an answer on June 3, 2026 at 11:13 am

    You could use DispatcherTimer. On each keypress, stop the timer if it’s already running, then start it. I believe (and you should check this!) that that will reset it.

    If it fires, you then take the current value in the textbox and start performing the operation in a separate thread (e.g. using Task.Factory.StartNew, if you’re using .NET 4, or BackgroundWorker, or just creating a new thread).

    Basically that separates the “new thread” part from the “do I really want to do something” part, keeping everything on the UI thread until the point where you’ve decided you really do want to do something (and you know the value you want to use).

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

Sidebar

Related Questions

I need to create a textbox that a user can enter an arbitrary string
I want to have a text box that the user can type in that
I have a user that want to be able to select a textbox and
I need to have a textbox (sort of) where the user can enter text
I have a textbox that the user can input into. Right now the user
In my website I have a textbox that allow user to enter a group
I have a TextBox on my ASP.NET webpage, where the user can enter a
What I want I have an EditText, where the user can enter a value,
I have a program which has a text box that the user can edit.
Hi I have a textbox that takes a username input. When the user submits

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.