using System.Windows; using System.Windows.Controls; namespace XAML_Example { /// /// Interaction logic for Window1.xaml /// public partial class Window1 : System.Windows.Window { int buttonValue = 1; public Window1() { InitializeComponent(); } void button1_Click(object sender, RoutedEventArgs e) { buttonValue += 1; this.label1.Content = buttonValue.ToString(); } } }