public HseDatePicker() { this.InitializeComponent(); //DataContext = this; InputTextBox.AddHandler(KeyDownEvent, new KeyEventHandler((s, e) => { if (e.Key == Windows.System.VirtualKey.Enter || e.Key == Windows.System.VirtualKey.Space) { //DatePickerPart.SelectedDateRange = new CalendarDateRange(SelectedDateTime, SelectedDateTime); //DatePickerPart.DisplayDate = SelectedDateTime; UpdateSelectedDateTimeString(SelectedDateTime.ToString("dd/MM/yyyy")); } else if (e.Key == Windows.System.VirtualKey.Delete) { SelectedDateTime = new DateTime(); //DatePickerPart.SelectedDateRange = null; //DatePickerPart.MoveToDate(DateTime.Now); UpdateSelectedDateTimeString(""); } }), true); }