private void TestDate_Focused(object sender, FocusEventArgs e) { if (MyResumeSyncViewModel.ShowTestSelection) { MyResumeSyncViewModel.ShowTestSelection = false; TestDate.Unfocus(); } var entryText = (sender as Entry)?.Text; if (DateTime.TryParseExact(entryText, "MM/dd/yyyy", CultureInfo.CurrentCulture, DateTimeStyles.None, out _)) { TestDate.Text = entryText; } else { ((ResumeSyncAssessmentViewModel)this.BindingContext).TestDateIsValid = false; TestDateStackLayout.BackgroundColor = TestDate.BackgroundColor = Color.White; TestDate.Text = ""; TestDate.TextColor = Colors.LightGrayColor; TestDate.FontAttributes = FontAttributes.None; TestDateFrame.BorderColor = Color.FromHex("#898D8D"); TestDateImageFrame.BackgroundColor = Color.FromHex("147cbd"); TestDateImageFrame.BorderColor = Color.FromHex("#898D8D"); } }
void TestDate_Tapped(object sender, System.EventArgs e) { if (MyResumeSyncViewModel.ShowTestSelection) { MyResumeSyncViewModel.ShowTestSelection = false; TestDate.Unfocus(); return; } if (Device.RuntimePlatform == Device.UWP) { DOB_Picker.ShowDatePicker(); } else { DOB_Picker.Focus(); } }