added samples
[windows-sources.git] / sdk / samples / WPFSamples / TextBox_DetectChangedText / csharp / window1.xaml.cs
blob7fc3df0f25daea79686db77297b7d3c84d98cfda
2 using System;
3 using System.Windows;
4 using System.Windows.Controls;
5 using System.Windows.Documents;
7 namespace SDKSample
10 public partial class Window1 : Window
13 // This is a counter for the number of times the TextChanged fires
14 // for the tbCountingChanges TextBox.
15 private int uiChanges = 0;
17 public Window1()
20 // Note that a call to InitializeComponent fires the TextChanged event when tbCountingChnages
21 InitializeComponent();
23 } // end Constructor
25 // Event handler for TextChanged Event.
26 private void textChangedEventHandler(object sender, TextChangedEventArgs args)
29 uiChanges++;
30 tbCounterText.Text = uiChanges.ToString();
32 } // end setChangedFlag