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