static void content_changed_callback(IntPtr target, IntPtr calldata, IntPtr closure) { ContentControl cc = (ContentControl)NativeDependencyObjectHelper.FromIntPtr(closure); var oldContent = Value.ToObject(typeof(object), NativeMethods.content_control_changed_event_args_get_old_content(calldata)); var newContent = Value.ToObject(typeof(object), NativeMethods.content_control_changed_event_args_get_new_content(calldata)); cc.OnContentChanged(oldContent, newContent); cc.RaiseUIAContentChanged(oldContent, newContent); }