I have a control subclassed from Canvas, with a property (“FilterN”) whose value is settable in the Inspector.
I have a computed property that uses FilterN in a calculation.
An instance of the control is placed via the IDE on a window, whose ImplicitInstance property is set to false. In App.Open, I create a new instance of the window and call its Show method.
Two things are happening that I don’t understand:
The Setter of the computed property is being called somehow, and I’m pretty sure not by my code, as there is only one call to the setter in the entire program, and a breakpoint set there doesn’t fire in this case. If I breakpoint in the setter, the stack trace indicates the instantiation of the window by App.Open is the “caller”.
At the moment the Setter is called, FilterN has not yet been initialized to its inspector-set value, i.e. it’s 0.
What’s going on here? Why is the setter being called, and why is the FilterN property not initialized at that time? You’d think (hope) that default properties would be initialized before just about anything else.