本文整理汇总了C#中Xamarin.Forms.Picker.Unfocus方法的典型用法代码示例。如果您正苦于以下问题:C# Picker.Unfocus方法的具体用法?C# Picker.Unfocus怎么用?C# Picker.Unfocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xamarin.Forms.Picker
的用法示例。
在下文中一共展示了Picker.Unfocus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewPlayerPage
public NewPlayerPage()
{
this.BindingContext = new FootballPlayerViewModel ();
BackgroundColor = Color.FromHex ("#008080");
Title = "Player Details";
Entry Player_FName = new Entry {
Placeholder = "First Name"
};
Entry Player_LName = new Entry {
Placeholder = "Last Name"
};
DatePicker Date_of_Birth = new DatePicker {
MaximumDate = DateTime.Now
};
Editor Description_Editor = new Editor ();
string[] Country_Picker_array = new string[] {
"Argentina", "Australia",
"Belgium", "Brazil",
"Canada", "China", "Croatia",
"Denmark",
"Ecuador", "Egypt", "El Salvador", "England", "Ethiopia",
"Germany",
"India", "Italy",
"Japan",
"Malasya",
"Netherlands", "NewZealand",
"Qatar",
"South Africa"
};
Picker Country_Picker = new Picker ();
foreach (string country_string in Country_Picker_array)
Country_Picker.Items.Add (country_string);
Button Save_Button = new Button {
Text = "Save Details",
BackgroundColor = Color.White,
BorderRadius = 5,
HorizontalOptions = LayoutOptions.Center
};
//Save_Button.Command = this.SetBinding (Button.CommandProperty,"SaveCommand");
Save_Button.Clicked += (object sender, EventArgs e) => {
Player_FName.Unfocus ();
Player_LName.Unfocus ();
Description_Editor.Unfocus ();
Country_Picker.Unfocus ();
Date_of_Birth.Unfocus ();
if (Player_FName.Text == null || Player_LName.Text == null) {
DisplayAlert ("Warning", "Empty Player Name field", "Return");
} else if (Country_Picker.SelectedIndex == -1) {
DisplayAlert ("Warning", "Empty Country field", "Return");
} else if (Description_Editor.Text == null)
DisplayAlert ("Warning", "Empty Description field", "Return");
else {
saveToDataBase (new FootballPlayer (
Player_FName.Text,
Player_LName.Text,
Date_of_Birth.Date.ToString("MMMM dd, yyyy"),
Country_Picker_array [Country_Picker.SelectedIndex],
Description_Editor.Text
));
}
};
StackLayout content_stacklayout = new StackLayout ();
ScrollView Customer_Details_ScrollView = new ScrollView {
WidthRequest = ((content_stacklayout.Width * 2) / 3),
VerticalOptions = LayoutOptions.Center,
Content = new StackLayout {
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
Text = "Player Name :"
},
Player_FName,
Player_LName,
new Label {
Text = "Date of Birth :"
},
Date_of_Birth,
new Label {
Text = "Description :"
},
Description_Editor,
new Label {
//.........这里部分代码省略.........