Converting it to VB

Just to tie the previous two blog posts together, I copied the C# into Instant VB and here is what it spit out (line break added to fit)

Private Sub AnyPropertyCheckBox_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim isVisible As Nullable(Of Boolean) = Not AnyPropertyCheckBox.IsChecked
    For Each uie As UIElement In LayoutRoot.Children
        Dim cb As CheckBox = TryCast(uie, CheckBox)
        If cb IsNot Nothing Then
            If cb.Tag IsNot Nothing AndAlso cb.Tag.ToString().ToUpper() = "SEARCHCRITERIA" Then
                cb.Visibility = If(isVisible.GetValueOrDefault() = True, _
Visibility.Visible, Visibility.Collapsed) End If ' end if tag match End If ' end if check box Next uie ' end for each element End Sub ' end method

About Jesse Liberty

Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen Pluralsight & LinkedIn Learning courses. He was a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Xamarin Certified Mobile Developer and a Xamarin MVP and a Microsoft MVP.
This entry was posted in z Silverlight Archives. Bookmark the permalink.