DatePickers.cs 645 B

12345678910111213141516171819202122232425262728
  1. using Terminal.Gui;
  2. namespace UICatalog.Scenarios;
  3. [ScenarioMetadata ("Date Picker", "Demonstrates how to use DatePicker class")]
  4. [ScenarioCategory ("Controls")]
  5. [ScenarioCategory ("DateTime")]
  6. public class DatePickers : Scenario
  7. {
  8. public override void Main ()
  9. {
  10. Application.Init ();
  11. Window app = new ()
  12. {
  13. Title = $"{Application.QuitKey} to Quit - Scenario: {GetName ()}"
  14. };
  15. var datePicker = new DatePicker { Y = Pos.Center (), X = Pos.Center () };
  16. app.Add (datePicker);
  17. Application.Run (app);
  18. app.Dispose ();
  19. Application.Shutdown ();
  20. }
  21. }