using Gtk; using System; public class CalendarDialog : Dialog { private Calendar calendar; public DateTime Date { get { return calendar.GetDate (); } } 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); calendar.Show (); /* Botones */ AddButton ("_Close", ResponseType.Close); AddButton ("_Aceptar", ResponseType.Accept); } }