Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Controlling event-driven navigation in a WPF application
- For Each ThisControl In MainListView.
- Dim ThisControlType = ThisControl.GetType
- Dim ThisControlPropertyChangedEvent = ThisControlType.GetEvent("PropertyChanged")
- ' you might wanna check here if event is not null / nothing
- ThisControlPropertyChangedEvent.AddEventHandler(ThisControl, New PropertyChangedEventHandler(AddressOf APropChanged))
- Next
- Public Sub APropChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs)
- If e.PropertyName = "Validated" Then
- Dim ValidatedForAll = True
- For Each ThisControl In MainListView.Items
- Dim ThisControlType = ThisControl.GetType
- Dim ThisControlValidatedProperty = ThisControlType.GetProperty("Validated")
- 'you might wanna check for non null here
- If Not ThisControlValidatedProperty.GetValue(ThisControl, Nothing) Then
- ValidatedForAll = False
- Exit For
- End If
- Next
- If ValidatedForAll Then
- MessageBox.Show("Yeeppee") ' you might send an event instead.
- End If
- End If
- End Sub
Add Comment
Please, Sign In to add comment