2 Imports System
.Windows
.Controls
3 Imports System
.Windows
.Media
4 Imports System
.Windows
.Shapes
5 Imports System
.Collections
8 Public Partial Class DPClearValue
9 Private Sub RestoreDefaultProperties(ByVal sender
As Object, ByVal e
As RoutedEventArgs
)
10 Dim uic
As UIElementCollection
= Sandbox
.Children
11 For Each uie
As Shape
In uic
12 Dim locallySetProperties
As LocalValueEnumerator
= uie
.GetLocalValueEnumerator()
13 While locallySetProperties
.MoveNext()
14 Dim propertyToClear
As DependencyProperty
= locallySetProperties
.Current
.Property
15 If Not propertyToClear
.ReadOnly
Then
16 uie
.ClearValue(propertyToClear
)
21 Private Sub MakeEverythingRed(ByVal sender
As Object, ByVal e
As RoutedEventArgs
)
22 Dim uic
As UIElementCollection
= Sandbox
.Children
23 For Each uie
As Shape
In uic
24 uie
.Fill
= New SolidColorBrush(Colors
.Red
)