Stylus.PreviewStylusOutOfRange Evento Anexado
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Acontece quando a caneta sai do alcance do tablet.
see AddPreviewStylusOutOfRangeHandler, and RemovePreviewStylusOutOfRangeHandler
see AddPreviewStylusOutOfRangeHandler, and RemovePreviewStylusOutOfRangeHandler
see AddPreviewStylusOutOfRangeHandler, and RemovePreviewStylusOutOfRangeHandler
Exemplos
O exemplo seguinte demonstra como determinar se a agulha está invertida. Este exemplo assume que existe um TextBox chamado textBox1 e que o PreviewStylusOutOfRange evento está ligado aos gestores de eventos.
void textbox1_PreviewStylusOutOfRange(object sender, StylusEventArgs e)
{
if (e.StylusDevice.Inverted)
{
textbox1.AppendText("Pen is inverted\n");
}
else
{
textbox1.AppendText("Pen is not inverted\n");
}
}
Private Sub textbox1_PreviewStylusOutOfRange(ByVal sender As Object, _
ByVal e As StylusEventArgs) Handles textbox1.PreviewStylusOutOfRange
If e.StylusDevice.Inverted Then
textbox1.AppendText("Pen is inverted" & vbLf)
Else
textbox1.AppendText("Pen is not inverted" & vbLf)
End If
End Sub
Observações
Este é um evento anexado. O WPF implementa eventos anexos como eventos encaminhados. Um evento associado é, fundamentalmente, um conceito de linguagem XAML usado para referenciar eventos que são tratados em objetos que, por si só, não definem eventos. O WPF expande ainda mais as capacidades de um evento anexado, permitindo-lhe percorrer uma rota. Os eventos anexados não têm uma sintaxe de tratamento direta no código; para anexar handlers para um evento encaminhado no código, use um método designado Add*Handler. Para mais detalhes, consulte a Visão Geral dos Eventos em Anexo.
Informação sobre Eventos Roteados
| Iteme | Value |
|---|---|
| Campo identificador | PreviewStylusOutOfRangeEvent |
| Estratégia de encaminhamento | Tunneling |
| Delegar | StylusEventHandler |