当前位置: 首页>>代码示例>>C#>>正文


C# Picker.Focus方法代码示例

本文整理汇总了C#中Xamarin.Forms.Picker.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# Picker.Focus方法的具体用法?C# Picker.Focus怎么用?C# Picker.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Xamarin.Forms.Picker的用法示例。


在下文中一共展示了Picker.Focus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateEventPage


//.........这里部分代码省略.........
			TimePicker endTimePicker = new TimePicker();
			endTimePicker.WidthRequest = 0;
			endTimePicker.HeightRequest = 0;
			endTimePicker.IsVisible = false;
			endTimePicker.PropertyChanged += (object sender, System.ComponentModel.PropertyChangedEventArgs e) => 
			{
                try
                {
                    if ("Time" == e.PropertyName)
                    {
                        string amPM = (endTimePicker.Time.Hours > 12) ? "PM" : "AM";
                        endTimePickerButton.Text = endTimePicker.Time.ToString();// endTimePicker.Time.Hours.ToString () + " : " + endTimePicker.Time.Minutes.ToString() + "  " + amPM;
                    }
                }
                catch (Exception ex)
                {
                    var test = ex.Message;
                }
			};

            //startDatePickerButton = new CustomImageButton();
            startDatePickerButton.ImageName = Device.OnPlatform("select_box_whitebg.png", "select_box_whitebg.png", "//Assets//select_box_whitebg.png");
            startDatePickerButton.Text = "Start Date";
            startDatePickerButton.FontSize = 17;
            startDatePickerButton.FontFamily = Constants.HELVERTICA_NEUE_LT_STD;
            startDatePickerButton.TextOrientation = interfaces.TextOrientation.Left;
            startDatePickerButton.TextColor = Color.Gray;
            startDatePickerButton.WidthRequest = deviceSpec.ScreenWidth * 40 / 100;
			startDatePickerButton.Clicked += (object sender, EventArgs e) => 
			{
                try
                {
					startDatePicker.Date = DateTime.Now.AddDays(1);
                    startDatePicker.Focus();
                }
                catch (Exception ex)
                {
                    var test = ex.Message;
                }
			};



           // startTimePickerButton = new CustomImageButton();
            startTimePickerButton.ImageName = Device.OnPlatform("select_box_whitebg.png", "select_box_whitebg.png", "//Assets//select_box_whitebg.png");
            startTimePickerButton.Text = " Start Time";
            startTimePickerButton.TextOrientation = TextOrientation.Middle;         
            startTimePickerButton.FontSize = 17;
            startTimePickerButton.FontFamily = Constants.HELVERTICA_NEUE_LT_STD;
            startTimePickerButton.TextOrientation = interfaces.TextOrientation.Left;
            startTimePickerButton.TextColor = Color.Gray;
            startTimePickerButton.WidthRequest = deviceSpec.ScreenWidth * 40 / 100;
			startTimePickerButton.Clicked += (object sender, EventArgs e) => 
			{
                try
                {
                    startTimePicker.Time = new TimeSpan(12, 00, 00);
                    startTimePicker.Focus();
                }
                catch (Exception ex)
                {
                    var test = ex.Message;
                }
			};
		
		
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:65,代码来源:CreateEventPage.cs


注:本文中的Xamarin.Forms.Picker.Focus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。