Skip to content

Commit 2559fb3

Browse files
committed
Updated test sample
1 parent dc003ca commit 2559fb3

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/Controls/tests/DeviceTests/Elements/DatePicker/DatePickerTests.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,22 @@ await CreateHandlerAndAddToWindow<DatePickerHandler>(datePicker, async (handler)
4646
{
4747
await InvokeOnMainThreadAsync(() =>
4848
{
49+
datePicker.Date = newDate;
50+
4951
#if ANDROID
50-
if (handler.DatePickerDialog != null)
51-
{
52-
var previousDate = handler.VirtualView.Date;
53-
handler.VirtualView.Date = newDate;
54-
}
52+
handler.DatePickerDialog?.UpdateDate(newDate.Year, newDate.Month - 1, newDate.Day);
5553
#elif IOS
5654
if (handler.DatePickerDialog != null)
5755
{
5856
handler.DatePickerDialog.SetDate(newDate.ToNSDate(), false);
59-
typeof(DatePickerHandler).GetMethod("SetVirtualViewDate",
60-
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?
61-
.Invoke(handler, null);
6257
}
6358
#elif WINDOWS
6459
if (handler.PlatformView != null)
6560
{
6661
handler.PlatformView.Date = newDate;
6762
}
68-
#else
69-
handler.VirtualView.Date = newDate;
63+
#elif MACCATALYST
64+
handler.PlatformView.Date = newDate.ToNSDate();
7065
#endif
7166
});
7267

0 commit comments

Comments
 (0)