Stylus.PreviewStylusSystemGesture Присоединенное событие
Определение
Возникает, когда пользователь выполняет системный жест с помощью этого пера.Occurs when the user makes a system gesture with this stylus.
see AddPreviewStylusSystemGestureHandler, and RemovePreviewStylusSystemGestureHandler
see AddPreviewStylusSystemGestureHandler, and RemovePreviewStylusSystemGestureHandler
see AddPreviewStylusSystemGestureHandler, and RemovePreviewStylusSystemGestureHandler
Примеры
В следующем примере показано, как определить системный жест, вызвавший PreviewStylusSystemGesture событие.The following example demonstrates how to determine the system gesture that raised the PreviewStylusSystemGesture event. В TextBox этом примере предполагается, что имеется textBox1
вызванный и PreviewStylusSystemGesture событие подключено к обработчикам событий.This example assumes that there is a TextBox called textBox1
and that the PreviewStylusSystemGesture event is connected to the event handlers.
void textbox1_PreviewStylusSystemGesture(object sender, StylusSystemGestureEventArgs e)
{
textbox1.AppendText(e.SystemGesture.ToString() + "\n");
}
Private Sub textbox1_PreviewStylusSystemGesture(ByVal sender As Object, _
ByVal e As StylusSystemGestureEventArgs) Handles textbox1.PreviewStylusSystemGesture
textbox1.AppendText(e.SystemGesture.ToString() & vbLf)
End Sub
Комментарии
Это вложенное событие.This is an attached event. WPFWPFреализует присоединенные события как перенаправленные события.implements attached events as routed events. Присоединенное событие — это, XAMLXAML по сути, понятие языка, используемое для ссылки на события, которые обрабатываются объектами, которые сами по себе не определяют события.An attached event is, fundamentally, a XAMLXAML language concept used to reference events that are handled on objects that do not, themselves, define events. WPFWPFдополнительно расширяет возможности присоединенного события, позволяя ему проходить по маршруту.further expands an attached event's capabilities, allowing it to traverse a route. Вложенные события не имеют синтаксиса прямой обработки в коде; чтобы присоединить обработчики для перенаправленного события в коде, используйте назначенный метод обработчика Add *.Attached events do not have a direct handling syntax in code; to attach handlers for a routed event in code, use a designated Add*Handler method. Дополнительные сведения см. в разделе Общие сведения о вложенных событиях.For details, see Attached Events Overview.
Сведения о маршрутизируемом событииRouted Event Information
Поле идентификатораIdentifier field | PreviewStylusSystemGestureEvent |
Стратегия маршрутизацииRouting strategy | ТуннелированиеTunneling |
делегатDelegate | StylusSystemGestureEventHandler |