I had a recent request to add declarative support for GUI 2D Grid control. So, I’m adding row and column definitions and then grabbing the definition for possible future updates:
grid.addRowDefinition(props.height, props.isPixel); const valueAndUnit = grid.getRowDefinition(grid.rowCount - 1)!;
Now if that was consistent with other parts of the framework then I would be able to set those properties. ie:
valueAndUnit.isPixel = false, but that yields an error:
Cannot set property isPixel of [object Object] which has only a getter
I can see why after checking the code is that I would need to call
updateInPlace with the new values. I think this is a question for @msDestiny14.
I have worked quite a bit on MVVM and other GUI patterns that encapsulate change logic, so I would have thought that the ValueAndUnit would have published a “changed” event that would automatically have the control(s) using it to mark themselves as dirty and a Composite pattern to handle that transparently. Considering only I am asking this (didn’t see anything in forum search) then maybe it would not be a useful feature. One thing, for example, is that the fluent/builder design of the API makes it a bit more work to access the ValueAndUnit and it would appear more the intent is that most people leave those unchanged? Any thoughts on grids resizing automatically by setting the named properties (isPixel, value)?