public static UnmanagedEventHandler CreateTextCompositionEventHandlerDispatcher (TextCompositionEventHandler handler) { return SafeDispatcher( (sender, calldata, closure) => handler (NativeDependencyObjectHelper.FromIntPtr (closure), NativeDependencyObjectHelper.FromIntPtr (calldata) as TextCompositionEventArgs ?? new TextCompositionEventArgs (calldata, false)) ); }