maui-linux/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issu.../Issue2292.cs

40 строки
835 B
C#

using System.Diagnostics;
using Xamarin.Forms.CustomAttributes;
namespace Xamarin.Forms.Controls
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 2292, "DatePicker not shown when .Focus() is called", PlatformAffected.WinPhone)]
public class Issue2292 : ContentPage
{
public Issue2292 ()
{
var datePicker = new DatePicker ();
var datePickerBtn = new Button {
Text = "Click me to call .Focus on DatePicker"
};
datePickerBtn.Clicked += (sender, args) => {
datePicker.Focus ();
};
var datePickerBtn2 = new Button {
Text = "Click me to call .Unfocus on DatePicker"
};
datePickerBtn2.Clicked += (sender, args) => {
datePicker.Unfocus ();
};
Content = new StackLayout {
Children = {
datePickerBtn,
datePickerBtn2,
datePicker,
}
};
}
}
}