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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:06:48+00:00 2026-05-28T01:06:48+00:00

I have DPs a and b to which c is bound via i converter

  • 0

I have DPs a and b to which c is bound via i converter (note that a and b might be bound to another DP via a converter). I modify a and b or some of the DPs that they are bound to and then use c in a calculation. I do this in a for loop, and it is taking a really long time, the conditions is i=0; i<100000; i++). So I am wondering how efficient is data binding? And should it be used in scenarios like this?
Here is some sample code:

        for ( int i = 0; i < 100000; i++){
            //... code to pick m based on some random numbers
            hazards[m].Reactant1.Count -= 1;
            hazards[m].Reactant2.Count -= 1;
            hazards[m].Product.Count += 2;
            display.Text = hazards[m].Value.ToString();
        }

hazards.Value is bound to the count of the reactants via a converter, the count of the reactants is bound to a textbox text property. m is picked based on the hazard value and some random numbers.

  • 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-28T01:06:49+00:00Added an answer on May 28, 2026 at 1:06 am

    Long running task should never be run in the UI thread. If you run your long running calculation here your UI will be slow – independently of the speed of data binding. Since you block the updates of the UI.

    If you change the value in a background thread then you have to use a dispatcher who makes a thread switch for you. This again comes with an overhead.

    In both ways you have many factors who will slow down your application.
    And it doesn’t really say anything reliable on the efficiency of data binding.

    I suggest you write your code in a background thread and check if it is fast enough. If not use a profiler to check where your bottleneck is.

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

Sidebar

Related Questions

I have a complex WPF control that for some reasons (ie. performance) is not
I have two DPs that I update in a DefiningGeometry get: protected override Geometry
I'm trying to write some PowerShell functions that do some stuff and then transparently
Have some dates in my local Oracle 11g database that are in this format:
Have an app that can use tts to read text messages. It can also
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I am facing some problem in iPhone application development for Reading PDF. I have
I have made a custom textbox that inherits from textbox. using System.Drawing; using System;
Have some code: using (var ctx = new testDataContext()) { var options = new
i have xml file which contains lots of data. now i want to pick

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.