added samples
[windows-sources.git] / sdk / samples / WPFSamples / DPClearValue / visualbasic / default.xaml.vb
blobf399d91470572a949bfe8209f9541656cf9e424a
1 Imports System.Windows
2 Imports System.Windows.Controls
3 Imports System.Windows.Media
4 Imports System.Windows.Shapes
5 Imports System.Collections
7 Namespace SDKSample
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)
17 End If
18 End While
19 Next
20 End Sub
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)
25 Next
26 End Sub
27 End Class
28 End Namespace