}
public CalendarDialog ():base ("Seleccionar Fecha", null, DialogFlags.DestroyWithParent)
+ {
+ Init ();
+ }
+
+ public CalendarDialog (string date):base ("Seleccionar Fecha", null, DialogFlags.DestroyWithParent)
+ {
+ Init ();
+ try {
+ calendar.Date = DateTime.Parse (date);
+ }
+ catch (Exception e) {
+ Console.WriteLine (e);
+ }
+ }
+
+ private void Init ()
{
calendar = new Calendar ();
VBox.PackStart (calendar);
public void OnSeleccionarFechaClicked (object o, EventArgs args)
{
- CalendarDialog d = new CalendarDialog ();
+
+ CalendarDialog d;
+ if (fechaNac.Text.Equals (""))
+ d = new CalendarDialog ();
+ else
+ d = new CalendarDialog (fechaNac.Text);
+
int response;
+
response = d.Run();
if (response == -3)
fechaNac.Text = d.Date.ToLongDateString ();