TextChangedEventArgs Sınıf

Tanım

TextChanged olayı için veriler sağlar.

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

Örnekler

Aşağıdaki örnekte, metnin TextBox kaç kez değiştiği gösterilir. Aşağıda, örneğin XAML kodu verilmiştir.

<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>

Aşağıda, örneğin arkasındaki kod verilmiştir.

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

Oluşturucular

Name Description
TextChangedEventArgs(RoutedEvent, UndoAction, ICollection<TextChange>)

Belirtilen olay kimliğini, geri alma eylemini TextChangedEventArgs ve metin değişikliklerini kullanarak sınıfın yeni bir örneğini başlatır.

TextChangedEventArgs(RoutedEvent, UndoAction)

Belirtilen olay kimliğini ve geri alma eylemini TextChangedEventArgs kullanarak sınıfının yeni bir örneğini başlatır.

Özellikler

Name Description
Changes

Oluşan değişiklikler hakkında bilgi içeren bir nesne koleksiyonu alır.

Handled

Yol boyunca giden bir olay için olay işlemenin mevcut durumunu gösteren bir değer alır veya ayarlar.

(Devralındığı yer: RoutedEventArgs)
OriginalSource

Bir üst sınıf tarafından herhangi bir olası Source ayarlamadan önce, saf isabet testi tarafından belirlenen özgün raporlama kaynağını alır.

(Devralındığı yer: RoutedEventArgs)
RoutedEvent

Bu RoutedEvent örnekle ilişkilendirilmiş öğesini RoutedEventArgs alır veya ayarlar.

(Devralındığı yer: RoutedEventArgs)
Source

Olayı tetikleyen nesneye bir başvuru alır veya ayarlar.

(Devralındığı yer: RoutedEventArgs)
UndoAction

Geri alma yığınının bu metin değişikliğine nasıl neden olduğunu veya bundan nasıl etkilendiğini alır.

Yöntemler

Name Description
Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Geçerli örneğin Type alır.

(Devralındığı yer: Object)
InvokeEventHandler(Delegate, Object)

Olay için tür güvenli TextChangedEventHandler temsilciyi çağırmak için uygun tür atamasını TextChanged gerçekleştirir.

MemberwiseClone()

Geçerli Objectbasit bir kopyasını oluşturur.

(Devralındığı yer: Object)
OnSetSource(Object)

Türetilmiş bir sınıfta geçersiz kılındığında, bir örneğin özelliğinin Source değeri her değiştiğinde bir bildirim geri çağırma giriş noktası sağlar.

(Devralındığı yer: RoutedEventArgs)
ToString()

Geçerli nesneyi temsil eden bir dize döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır