c# - PropertyChanged events need to fire once per click -


I am sitting in a scenario where I believe my system is starting to start scaling issues and I believe that this is caused by not doing anything "right way"

Basically I have a silverlight project and in this particular domain there are many dependencies in my model < Pre> int_Wight; Public gut weight ({return _Wight;} set {if (value! = _Wight) {_Weight = value; RaisePropertyChanged ("weight"); then}

After that model, My app also pastes an additional event on the converted event in the property

  myObject.PropertyChanged + = UpdateUI;   

My update does a bunch of updated UI graphic content It produces images that bindings are used.

And it works well.

But now suppose that my weight Property also has an effect on other properties, they also close the changing events of their properties (as they should, so all UI areas to be bound to those qualities will be updated), but then update the Ui all the time It means that if a property also affects 3 other properties, then the updated III will be trapped 4 times when it only results after the final property.

Anything, just inefficient and architecture seems wrong.

So what is essentially what I am asking, how can I get it that my UpdateUI only

Your architecture is closed once a series of properties changes I have two ides to know.

  1. Here is what I will choose, but more effort is needed - DesignUse UpdateUI method so that it can update according to the changed property, complete one property of one of hundreds of visual modals changes Do not refresh the way. For example, if a person view model changes, only update it.
  2. Run a pending layout update once in a few seconds. For example, you can start some types of timers that will check whether vertical layouts are updated (you have to do the architecture yourself) and have to execute them, or the last of them depend on you. It can be efficient but should be carefully prepared.

    I'm not familiar with Silverlight, only WPF, but I think the same principles apply.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -