The GeometryChanged event of the SketchEditor does sometimes return NewGeometry which equals OldGeometry even though that a point has been modifed using the editor.
Reproduction Steps:
Adding a point, deleting a point or moving multiple points will return the correct NewGeometry.
When registering to the PropertyChanged event and filtering for Geometry property the provided value is what I'd expected to be returned as NewGeometry from the GeometryChanged event. So registering to the PropertyChanged event is currently used by me as a workaround.
Solved! Go to Solution.
Thank you for reporting this issue and offering us a workaround. It does appear GeometryChanged to be raised earlier with an old value for NewGeometry. I just logged the issue so we can work on getting this fixed in future releases of the API.
The Undo/Redo for change in vertex positions however, appear to be working. But if you need to know when/what Geometry has changed to, GeometryChangedEventArgs.NewGeometry only reflects the change when a new vertex is added or a vertex gets deleted.
May I ask what you're using SketchEditor.Geometry for? Would it be something where two-way binding to this property can be done or is it necessary to do in code-behind where you subscribe to PropertyChanged event? Thanks.
Thank you for reporting this issue and offering us a workaround. It does appear GeometryChanged to be raised earlier with an old value for NewGeometry. I just logged the issue so we can work on getting this fixed in future releases of the API.
The Undo/Redo for change in vertex positions however, appear to be working. But if you need to know when/what Geometry has changed to, GeometryChangedEventArgs.NewGeometry only reflects the change when a new vertex is added or a vertex gets deleted.
May I ask what you're using SketchEditor.Geometry for? Would it be something where two-way binding to this property can be done or is it necessary to do in code-behind where you subscribe to PropertyChanged event? Thanks.
Using two-way binding is not applicable as I'm using the event in the context of my question Exit condition for SketchEditor
Using the SketchEditor as a measure tool, I experience the same. Adding new vertexes works, but if I move an existing point, e.NewGeometry holds OldGeometry. Moving the point again, I get the geometry I was supposed to get the previous time, and so on. I have a sample if needed