Imports System.ComponentModel

Public Class Telefono
  Implements INotifyPropertyChanged

  Private m_idPersona As Integer
  Public Property IdPersona() As Integer
    Get
      Return m_idPersona
    End Get
    Set(value As Integer)
      m_idPersona = value
      OnPropertyChanged(New PropertyChangedEventArgs("IdPersona"))
    End Set
  End Property

  Private m_nombre As String
  Public Property Nombre() As String
    Get
      Return m_nombre
    End Get
    Set(value As String)
      m_nombre = value
      OnPropertyChanged(New PropertyChangedEventArgs("Nombre"))
    End Set
  End Property

  Private m_direccion As String
  Public Property Direccion() As String
    Get
      Return m_direccion
    End Get
    Set(value As String)
      m_direccion = value
      OnPropertyChanged(New PropertyChangedEventArgs("Direccion"))
    End Set
  End Property

  Private m_telefono As String
  Public Property NumTelefono() As String
    Get
      Return m_telefono
    End Get
    Set(value As String)
      m_telefono = value
      OnPropertyChanged(New PropertyChangedEventArgs("Telefono"))
    End Set
  End Property

  Private m_observaciones As String
  Public Property Observaciones() As String
    Get
      Return m_observaciones
    End Get
    Set(value As String)
      m_observaciones = value
      OnPropertyChanged(New PropertyChangedEventArgs("Observaciones"))
    End Set
  End Property

  Private m_foto As Byte()
  Public Property Foto() As Byte()
    Get
      Return m_foto
    End Get
    Set(value As Byte())
      m_foto = value
      OnPropertyChanged(New PropertyChangedEventArgs("Foto"))
    End Set
  End Property

  Public Event PropertyChanged As PropertyChangedEventHandler _
    Implements INotifyPropertyChanged.PropertyChanged
  Public Sub OnPropertyChanged(e As PropertyChangedEventArgs)
    RaiseEvent PropertyChanged(Me, e) ' generar evento
  End Sub

  Public Overrides Function ToString() As String
    Return Nombre
  End Function

  Public Sub New(id As Integer)
    IdPersona = id
    Nombre = "¿Nombre?"
    Direccion = "¿Dirección?"
    NumTelefono = "000000000"
    Observaciones = "Ninguna"
    Foto = Nothing
  End Sub

  Public Sub New(id As Integer, nom As String, dir As String, tel As String, obs As String)
    IdPersona = id
    Nombre = nom
    Direccion = dir
    NumTelefono = tel
    Observaciones = obs
    Foto = Nothing
  End Sub
End Class
