UIElement.PreviewTextInput UIElement.PreviewTextInput UIElement.PreviewTextInput UIElement.PreviewTextInput Event


在此元素以设备无关模式获取文本时发生。Occurs when this element gets text in a device-independent manner.

 virtual event System::Windows::Input::TextCompositionEventHandler ^ PreviewTextInput;
public event System.Windows.Input.TextCompositionEventHandler PreviewTextInput;
member this.PreviewTextInput : System.Windows.Input.TextCompositionEventHandler 
Public Custom Event PreviewTextInput As TextCompositionEventHandler 



PreviewTextInput事件允许组件或应用程序以与设备无关的方式侦听文本输入。The PreviewTextInput event allows a component or application to listen for text input in a device-independent manner. 键盘是的主要方式PreviewTextInput, 但语音、手写和其他输入设备也可能会生成。 PreviewTextInputThe keyboard is the primary means of PreviewTextInput; but speech, handwriting, and other input devices can also generate PreviewTextInput.

由于键组合 (在默认键盘或通过输入法编辑器) 中, 多个键事件可能只引发一个文本输入事件。Because of key combinations - either in default keyboards or through input method editors - multiple key events may raise just one text input event.

此事件将为此类创建TextCompositionManager.PreviewTextInput附加事件的别名, 因此当继承PreviewTextInput为基元素时UIElement , 它是类成员列表的一部分。This event creates an alias for the TextCompositionManager.PreviewTextInput attached event for this class, so that PreviewTextInput is part of the class members list when UIElement is inherited as a base element. 附加到PreviewTextInput事件的事件处理程序附加到基础TextCompositionManager.PreviewTextInput附加事件, 并接收相同的事件数据实例。Event handlers that are attached to the PreviewTextInput event are attached to the underlying TextCompositionManager.PreviewTextInput attached event and receive the same event data instance.

路由事件信息Routed Event Information

标识符字段Identifier field PreviewTextInputEvent
路由策略Routing strategy 建立Tunneling
委托Delegate TextCompositionEventHandler