this my question is more about best practice, not specifically targeted to C++ or C#. C# is preferred in my current project, but when the solution will be available in C++ only, no problem.
Situation: There is an element with custom EC data attached. The data are available in Properties (Element Information) dialog and can be modified by a user. Such change is saved to persistent storage (DGN V8 file) by MicroStation automatically.
Question: Is it possible and what is recommended approch to monitor such change to be able to react on the change (e.g. to modify the element size/shape/etc.)?
I have not done any testing or research yet, but I can imagine that XAttribute changed event is fired when EC data are changed, but it seems to me a bit complicated (go through the whole path from XAttribute, test whether it's EC data or not and to what element it belongs). Maybe there is some other solution available, e.g. to monitor EC data particularly or to hook system responsible for rendering EC data in GUI?
Nobody has an idea? I see more developers have joined this question...
I prepared simple example to illustrate my question:
There is a custom EC schema storing number of vertices of placed regular polygons (shapes).
When regular triangle is placed, properties Vertices (integer) holds value 3:
Because Vertices property is not read only, it can be edited by user. When he changes it to e.g. value 5, application should be able to monitor this event and modify the shape element to have 5 vertices:
How to monitor EC property is changed?
Robert Hook or Paul Connelly or somebody else?
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point