Public Class CAlumno
  Public Property Id() As Integer
  Public Property NomAlumno() As String

  Public Sub New()
    Id = 0
    NomAlumno = "nombre y apellidos"
  End Sub
End Class

Partial Public Class VentanaNuevoAlumno
  Inherits ChildWindow

  Public Property Nuevo_alumno() As CAlumno

  Public Sub New()
    InitializeComponent()
    Nuevo_alumno = New CAlumno()
    dfNuevoAlumno.CurrentItem = Nuevo_alumno
    dfNuevoAlumno.BeginEdit()
  End Sub

  Private Sub OKButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles OKButton.Click
    dfNuevoAlumno.CommitEdit()
    Me.DialogResult = True
  End Sub

  Private Sub CancelButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles CancelButton.Click
    Nuevo_alumno = Nothing
    dfNuevoAlumno.CancelEdit()
    Me.DialogResult = False
  End Sub

End Class
