ReplaceInModel on its self has always been kinda iffy for me.
Try this:
IntPtr elementRef = element.GetNativeElementRef();
// Do your PropertySetter here..
Element originalEle = Element.GetFromElementRef(_elementRef);
element.ReplaceInModel(originalEle );
originalEle.Dispose();
Also, you should probably wrap your PropertySetter with Using as it should be disposed.
Try this:
IntPtr elementRef = element.GetNativeElementRef();
// Do your PropertySetter here..
Element originalEle = Element.GetFromElementRef(_elementRef);
element.ReplaceInModel(originalEle );
originalEle.Dispose();
Also, you should probably wrap your PropertySetter with Using as it should be disposed.