!!! Listing 1
!!! Listing.2
public Page()
{
InitializeComponent();
Loaded += new RoutedEventHandler(Page_Loaded);
}
void Page_Loaded(object sender, RoutedEventArgs e)
{
MyButton.Click += new RoutedEventHandler(MyButton_Click);
}
void MyButton_Click(object sender, RoutedEventArgs e)
{
if ((MyButton.Content as String).Contains("Klick mich"))
{
MyButton.Content = "Button geklickt!";
}
else
{
MyButton.Content = "Klick mich nochmal!";
}
}