-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml.vb
More file actions
42 lines (31 loc) · 1.27 KB
/
MainWindow.xaml.vb
File metadata and controls
42 lines (31 loc) · 1.27 KB
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
Imports System
Imports System.Collections.Generic
Imports System.Windows
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Namespace WpfApplication2
Public Partial Class MainWindow
Inherits Window
Public Sub New()
Me.InitializeComponent()
End Sub
Public ReadOnly Property Agents As List(Of Agent)
Get
Return DataSource
End Get
End Property
End Class
Public Class Agent
Public Property AgentName As String
Public Property Phone As String
Public Property Photo As String
Public ReadOnly Property PhotoSource As ImageSource
Get
Return If(String.IsNullOrEmpty(Photo), Nothing, New BitmapImage(New Uri(Photo, UriKind.Relative)))
End Get
End Property
End Class
Public Module Agents
Public ReadOnly DataSource As List(Of Agent) = New List(Of Agent) From {New Agent With {.AgentName = "Anthony Peterson", .Phone = "(555) 444-0782", .Photo = "Images/1.jpg"}, New Agent With {.AgentName = "Rachel Scott", .Phone = "(555) 249-1614", .Photo = "Images/2.jpg"}, New Agent With {.AgentName = "Albert Walker", .Phone = "(555) 232-2303", .Photo = "Images/3.jpg"}}
End Module
End Namespace