views:

75

answers:

1

Currently working through a Teach Yourself WPF tutorial. Usually I can mentally convert from C# to VB without any problem but this C# syntax is unfamiliar. How is it written in VB?

Private void Button_Click(object sender, RoutedEventArgs e)
{
    ((Person)DataContext).FirstName = "blah blah"
}

My usual fave online converters are choking on this ... perhaps because they don't do WPF?

+1  A: 

try this

Private Sub Button_Click(ByVal sender As System.Object, ByVal e as RoutedEventArgs) Handles Button.Click
 DirectCast(DataContext, Person).FirstName = "blah blah"
End Sub
Pharabus