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.