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


C# Spinner.PerformClick方法代码示例

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


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

示例1: OnCreate


//.........这里部分代码省略.........



			imgBtnPlus.Click += (object sender, EventArgs e) => {
				if (SetTag == 1) {
					imgBtnPlus.SetImageResource (Resource.Drawable.Multsign);
					txtidofNewPanel.Visibility = ViewStates.Visible;
					tRowSaveCancel.Visibility = ViewStates.Visible;
					spinMasterPanel.Visibility = ViewStates.Visible;
					SetTag = 0;

				} else if (SetTag == 0) {
					imgBtnPlus.SetImageResource (Resource.Drawable.plussign);

					txtidofNewPanel.Visibility = ViewStates.Gone;
					tRowSaveCancel.Visibility = ViewStates.Gone;
					spinMasterPanel.Visibility = ViewStates.Gone;
					SetTag = 1;
				}
			};

			btnCancel.Click += delegate {

				imgBtnPlus.SetImageResource (Resource.Drawable.plussign);
				tRowSaveCancel.Visibility = ViewStates.Gone;
				txtidofNewPanel.Visibility = ViewStates.Gone;
				spinMasterPanel.Visibility = ViewStates.Gone;

			};


			#region SavePanelCLickActivity

			btnSavePanel.Click += (object sender, EventArgs e) => {
				
				imgBtnPlus.SetImageResource (Resource.Drawable.plussign);
				tRowSaveCancel.Visibility = ViewStates.Gone;
				txtidofNewPanel.Visibility = ViewStates.Gone;
				spinMasterPanel.Visibility = ViewStates.Gone;
				string newPanelText = txtidofNewPanel.Text.Trim ();

				if (newPanelText != "") {
					string spinnerItem = spinMasterPanel.SelectedItem.ToString ();   // Selected item in the spinner

					if (spinnerItem != "Select Parent Panel") {
						child = new List<string> ();
						child.Add (newPanelText);

						if (NewParentItems.ContainsKey (spinnerItem)) {
							NewParentItems [spinnerItem].AddRange (child);
							dictPanelItemsForMail [spinnerItem].AddRange (child);
							
						} else {
                            
							NewParentItems [spinnerItem] = child;
							dictPanelItemsForMail [spinnerItem] = child;

						}


					} else {
						
						child = new List<string> ();
						NewParentItems [newPanelText] = child;
						dictPanelItemsForMail [newPanelText] = child;
						appendSpinner (spinMasterPanel, newListForSpin, spinnerArrayAdapter, First);
					}

					child = new List<string> ();
					childItems.Add (child);
					myListViewAdap adapterNew = new myListViewAdap (NewParentItems);
					adapterNew.setInflater ((LayoutInflater)GetSystemService (Context.LayoutInflaterService), this);
					mListExView.SetAdapter (adapter);									//Inflate Expandable Adapter
							
					txtidofNewPanel.Text = "";
					InputMethodManager inputmanager = (InputMethodManager)GetSystemService (Context.InputMethodService);
					inputmanager.HideSoftInputFromWindow (txtidofNewPanel.WindowToken, HideSoftInputFlags.None);		// To hide the keyboard

					spinMasterPanel.SetSelection (0, true);
				}
			};

			#endregion SavePanelActivityEnd


			// Code to hide keyboard on spinner touch
			spinMasterPanel.Touch += (object sender, View.TouchEventArgs e) => {

				InputMethodManager inputmanager = (InputMethodManager)GetSystemService (Context.InputMethodService);
				inputmanager.HideSoftInputFromWindow (spinMasterPanel.WindowToken, HideSoftInputFlags.None);	
				spinMasterPanel.PerformClick ();
			};


			// code to handle ChildClick Event
			mListExView.ChildClick += mListExView_ChildClick;

			connectMaster (1);
	
		}
开发者ID:kanwar23,项目名称:myFirstOne,代码行数:101,代码来源:MainActivity.cs


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