-
Notifications
You must be signed in to change notification settings - Fork 500
/
Copy pathBlankPage.xaml.vb
58 lines (44 loc) · 1.74 KB
/
BlankPage.xaml.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Imports Windows.UI
Public NotInheritable Class BlankPage
Inherits Page
Public Sub New()
InitializeComponent()
'<SnippetDataContext>
' Create an instance of the MyColors class
' that implements INotifyPropertyChanged.
Dim textcolor As New MyColors()
' Brush1 is set to be a SolidColorBrush with the value Red.
textcolor.Brush1 = New SolidColorBrush(Colors.Red)
' Set the DataContext of the TextBox MyTextBox.
MyTextBox.DataContext = textcolor
'</SnippetDataContext>
End Sub
'<Snippet1>
' Create a class that implements INotifyPropertyChanged.
Public Class MyColors
Implements INotifyPropertyChanged
Private _Brush1 As SolidColorBrush
' Declare the PropertyChanged event.
Public Event PropertyChanged As PropertyChangedEventHandler _
Implements INotifyPropertyChanged.PropertyChanged
' Create the property that will be the source of the binding.
Public Property Brush1() As SolidColorBrush
Get
Return _Brush1
End Get
Set(ByVal value As SolidColorBrush)
_Brush1 = value
' Call NotifyPropertyChanged when the source property
' is updated.
NotifyPropertyChanged("Brush1")
End Set
End Property
' NotifyPropertyChanged will raise the PropertyChanged event,
' passing the source property that is being updated.
Public Sub NotifyPropertyChanged(ByVal propertyName As String)
RaiseEvent PropertyChanged(Me, _
New PropertyChangedEventArgs(propertyName))
End Sub
End Class
'</Snippet1>
End Class