Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.ComponentModel
Imports System.Collections.ObjectModel

Namespace RadGridView_WPF_AR_162
	''' <summary>
	''' A football club.
	''' </summary>
	Public Class Club
		Implements INotifyPropertyChanged

		Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged

'INSTANT VB NOTE: The field name was renamed since Visual Basic does not allow fields to have the same name as methods:
		Private name_Renamed As String
'INSTANT VB NOTE: The field established was renamed since Visual Basic does not allow fields to have the same name as methods:
		Private established_Renamed As Date
'INSTANT VB NOTE: The field stadiumCapacity was renamed since Visual Basic does not allow fields to have the same name as methods:
		Private stadiumCapacity_Renamed As Integer

		Public Property Name() As String
			Get
				Return Me.name_Renamed
			End Get
			Set(ByVal value As String)
				If value <> Me.name_Renamed Then
					Me.name_Renamed = value
					Me.OnPropertyChanged("Name")
				End If
			End Set
		End Property

		Public Property Established() As Date
			Get
				Return Me.established_Renamed
			End Get
			Set(ByVal value As Date)
				If value <> Me.established_Renamed Then
					Me.established_Renamed = value
					Me.OnPropertyChanged("Established")
				End If
			End Set
		End Property

		Public Property StadiumCapacity() As Integer
			Get
				Return Me.stadiumCapacity_Renamed
			End Get
			Set(ByVal value As Integer)
				If value <> Me.stadiumCapacity_Renamed Then
					Me.stadiumCapacity_Renamed = value
					Me.OnPropertyChanged("StadiumCapacity")
				End If
			End Set
		End Property

		Public Sub New()

		End Sub

		Public Sub New(ByVal name As String, ByVal established As Date, ByVal stadiumCapacity As Integer)
			Me.name_Renamed = name
			Me.established_Renamed = established
			Me.stadiumCapacity_Renamed = stadiumCapacity
		End Sub

		Protected Overridable Sub OnPropertyChanged(ByVal args As PropertyChangedEventArgs)
			Dim handler As PropertyChangedEventHandler = Me.PropertyChangedEvent
			If handler IsNot Nothing Then
				handler(Me, args)
			End If
		End Sub

		Private Sub OnPropertyChanged(ByVal propertyName As String)
			Me.OnPropertyChanged(New PropertyChangedEventArgs(propertyName))
		End Sub

		Public Overrides Function ToString() As String
			Return Me.Name
		End Function

		Public Shared Function GetClubs() As ObservableCollection(Of Club)
			Dim clubs As New ObservableCollection(Of Club)()
'INSTANT VB NOTE: The variable club was renamed since it may cause conflicts with calls to static members of the user-defined type with this name:
			Dim club_Renamed As Club

			' Liverpool
			club_Renamed = New Club("Liverpool", New Date(1892, 1, 1), 45362)
			clubs.Add(club_Renamed)

			' Manchester Utd.
			club_Renamed = New Club("Manchester Utd.", New Date(1878, 1, 1), 76212)
			clubs.Add(club_Renamed)

			' Chelsea
			club_Renamed = New Club("Chelsea", New Date(1905, 1, 1), 42055)
			clubs.Add(club_Renamed)

			' Arsenal
			club_Renamed = New Club("Arsenal", New Date(1886, 1, 1), 60355)
			clubs.Add(club_Renamed)

			Return clubs
		End Function
	End Class
End Namespace
