protected virtual void DisconnectWrapped() { WrappedObject.RemoveNotification("id", NotifyIdHandler); if (WrappedObject is Cdn.Annotatable) { WrappedObject.RemoveNotification("annotation", NotifyAnnotationHandler); } WrappedObject.VariableAdded -= HandleVariableAdded; WrappedObject.VariableRemoved -= HandleVariableRemoved; WrappedObject.Copied -= HandleCopied; WrappedObject.TemplateApplied -= HandleTemplateApplied; WrappedObject.TemplateUnapplied -= HandleTemplateUnapplied; if (WrappedObject.SupportsLocation()) { RemoveLocationNotification(); } }
private void RemoveLocationNotification() { WrappedObject.RemoveNotification("x", OnLocationChanged); WrappedObject.RemoveNotification("y", OnLocationChanged); }