TextChangedEventArgs Klasa

Definicja

Udostępnia dane dla zdarzenia TextChanged.

public ref class TextChangedEventArgs : System::Windows::RoutedEventArgs
public class TextChangedEventArgs : System.Windows.RoutedEventArgs
type TextChangedEventArgs = class
    inherit RoutedEventArgs
Public Class TextChangedEventArgs
Inherits RoutedEventArgs
Dziedziczenie
TextChangedEventArgs

Przykłady

W poniższym przykładzie jest wyświetlana liczba zmian tekstu TextBox . Poniżej znajduje się kod XAML dla przykładu.

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
  x:Class="SDKSample.DetectChangedTextExample"
  Title="DetectChangedText">
  <StackPanel>
    <TextBox
      Name="tbCountingChanges"    
      TextChanged="textChangedEventHandler"
      TextWrapping="Wrap">
      Here is the initial text in the textbox.  Each time the contents of this box is changed, a change counter will
      be incremented and displayed in the TextBox below.  Note that the TextChanged event is called when the TextBox
      control is initially populated with text, so the changes counter starts of at 1.
    </TextBox>
    <TextBox Name="tbCounterText">0</TextBox>
    
  </StackPanel>  
</Page>

Poniżej znajduje się kod stojący za przykładem.

using System.Windows.Controls;

namespace SDKSample
{
    public partial class DetectChangedTextExample : Page
    {
        // This is a counter for the number of times the TextChanged fires
        // for the tbCountingChanges TextBox.
        private int uiChanges = 0;

        // Event handler for TextChanged Event.
        private void textChangedEventHandler(object sender, TextChangedEventArgs args)
        {

            uiChanges++;
            if (tbCounterText != null)
            {
                tbCounterText.Text = uiChanges.ToString();
            }
        }
    }
}

Namespace SDKSample

    Partial Public Class DetectChangedTextExample
        Inherits Page

        ' This is a counter for the number of times the TextChanged fires
        ' for the tbCountingChanges TextBox.
        Private uiChanges As Integer = 0

        ' Event handler for TextChanged Event.
        Private Sub textChangedEventHandler(ByVal sender As Object,
                                            ByVal args As TextChangedEventArgs)

            uiChanges += 1
            If tbCounterText IsNot Nothing Then
                tbCounterText.Text = uiChanges.ToString()
            End If

        End Sub
    End Class
End Namespace

Konstruktory

TextChangedEventArgs(RoutedEvent, UndoAction)

Inicjuje TextChangedEventArgs nowe wystąpienie klasy przy użyciu określonego identyfikatora zdarzenia i cofa akcję.

TextChangedEventArgs(RoutedEvent, UndoAction, ICollection<TextChange>)

Inicjuje TextChangedEventArgs nowe wystąpienie klasy przy użyciu określonego identyfikatora zdarzenia, cofnij akcję i zmiany tekstu.

Właściwości

Changes

Pobiera kolekcję obiektów, które zawierają informacje o zmianach, które wystąpiły.

Handled

Pobiera lub ustawia wartość wskazującą obecny stan obsługi zdarzeń dla zdarzenia kierowanego podczas podróży trasy.

(Odziedziczone po RoutedEventArgs)
OriginalSource

Pobiera oryginalne źródło raportowania określone przez testowanie czystych trafień przed ewentualnym Source dostosowaniem przez klasę nadrzędną.

(Odziedziczone po RoutedEventArgs)
RoutedEvent

Pobiera lub ustawia RoutedEvent skojarzone z tym RoutedEventArgs wystąpieniem.

(Odziedziczone po RoutedEventArgs)
Source

Pobiera lub ustawia odwołanie do obiektu, który wywołał zdarzenie.

(Odziedziczone po RoutedEventArgs)
UndoAction

Pobiera sposób, w jaki stos cofania jest spowodowany zmianą tekstu lub na nią wpływa.

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
InvokeEventHandler(Delegate, Object)

Wykonuje rzutowanie odpowiedniego typu, aby wywołać delegata bezpiecznego TextChangedEventHandler typu dla TextChanged zdarzenia.

MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
OnSetSource(Object)

Podczas zastępowania w klasie pochodnej zapewnia punkt wejścia wywołania zwrotnego powiadomień przy każdej zmianie wartości Source właściwości wystąpienia.

(Odziedziczone po RoutedEventArgs)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy