When inspecting an UltraTreeNode that was previously added to the root of the Tree, I see that Index (getter) is 0 but index (property) is 3.
3 is the correct value.
Any idea why the getter would return 0 instead of 3?
Kind regards, Lieven Cardoen
There are cases where the getter will fix up the index member variable when the value is stale. You must be breaking at a point when that is occurring. In these cases, however, the Index property getter will update the index member, so it is no longer stale. Maybe the Debug window isn't picking up on the refresh.
Also keep in mind that it's possible that the act of calling into the property getter might be altering the value of the index member.
I'm not using that. It's the Visual Studio Debugger that's using reflection. Anyway, the two do differ, and only the index without capital is showing the correct value...
Only the Index (captial) property is exposed on the control. If you are seeing the index (lower case), which is an internal member variable, then you must be using reflection, and you should not use that.
Well, when inspecting the variable, there's Index (with capital) and index. Both of them are not the same. So I guess encapsulation is doing this.
I'll try to take a screenshot if that helps.
Lieven
Hi,
I don't understand the distinction you are making. What's the difference between the property and the getter? The getter is a part of the property that returns the value. There's no difference.