Ivan

Ivan

  • NA
  • 29
  • 5.7k

a doubt about simple property

May 26 2011 10:06 AM
Hello to everybody...

I'm fighting hardly against the INotifyPropertyChanged and similars...

I managed to bind the height of a simple rectangle to the value incremented on the base of a timer. (the rectangle grows while the time is passing)..

Now what i should do is to bind 5 different rectangles to 5 different float values changing continuosly inside a List<float> or a float[] (i'm working with the list)..

I couldn't do that, but the main thing i noted is that if i set in my class:

---------------------------------------------
private List<float> _flowValuesSplitter;

public List<float> FlowValuesSplitter
        {
            get { return _flowValuesSplitter; }
            set
            {
                if (_flowValuesSplitter != value)
                {
                    _flowValuesSplitter = value;
                    OnPropertyChanged("Value");
                   
                }
            }
        }

(I implemented the OnpropertyChanged... )

what i discovered is that when i Initialize the List<float> with ->  FlowValuesSplitter= new List<float>{0,0,0,0,0}

the code enters in the setter of the Property, but when later i do:

for (int s = 0; s < FlowValuesSplitter.Count; s++)
            {
                FlowValuesSplitter[s] += (float)(6.7);
            }

the code doens't enter in the property setter...

Did i miss smt basic????

thanks, I.

Answers (6)