How can I check the .Text property of the sender object in my event?
1 answer
Something like the pseudo code below:
private void NuestroButton1_Click(object sender, RoutedEventArgs e)
{
Button foo = sender as Button; // Cast to the type we're expecting it to be
if( foo != null && foo.Content == "X" )
{
//Do something
System.Windows.Browser.HtmlPage.Window.Alert("Hello World");
}
}
+6
source to share