-
Notifications
You must be signed in to change notification settings - Fork 500
/
Copy pathPage.xaml.vb
87 lines (70 loc) · 2.18 KB
/
Page.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
'<Snippet10_VB>
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Documents
Imports System.Windows.Ink
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Shapes
Imports System.Collections.ObjectModel
Partial Public Class Page
Inherits UserControl
Public Sub New()
' Required to initialize variables
InitializeComponent()
End Sub
'<Snippet111_VB>
Private Sub PrintText(ByVal sender As Object, ByVal args As SelectionChangedEventArgs)
Dim lbi As ListBoxItem = TryCast(TryCast(sender, ListBox).SelectedItem, ListBoxItem)
textBlock1.Text = " You selected " + lbi.Content.ToString() + "."
End Sub
'</Snippet111_VB>
End Class
'<Snippet101_VB>
Public Class Customer
Private _firstName As String
Private _lastName As String
Private _address As String
Public Property FirstName() As String
Get
Return _firstName
End Get
Set(ByVal value As String)
_firstName = value
End Set
End Property
Public Property LastName() As String
Get
Return _lastName
End Get
Set(ByVal value As String)
_lastName = value
End Set
End Property
Public Property Address() As String
Get
Return _address
End Get
Set(ByVal value As String)
_address = value
End Set
End Property
Public Sub New(ByVal firstName As String, ByVal lastName As String, ByVal address As String)
Me.FirstName = firstName
Me.LastName = lastName
Me.Address = address
End Sub
End Class
Public Class Customers
Inherits ObservableCollection(Of Customer)
Public Sub New()
Add(New Customer("Michael", "Anderberg", "12 North Third Street, Apartment 45"))
Add(New Customer("Chris", "Ashton", "34 West Fifth Street, Apartment 67"))
Add(New Customer("Seo-yun", "Jun", "56 East Seventh Street, Apartment 89"))
Add(New Customer("Guido", "Pica", "78 South Ninth Street, Apartment 10"))
End Sub
End Class
' </Snippet101_VB>
'</Snippet10_VB>