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


C# ToggleButton.SetOnCheckedChangeListener方法代码示例

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


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

示例1: GetView

        public override View GetView(Context context, View convertView, ViewGroup parent)
        {
            View toggleButtonView;
            View view = DroidResources.LoadBooleanElementLayout(context, convertView, parent, LayoutId, out _caption, out _subCaption, out toggleButtonView);

            if (view != null)
            {
                _caption.Text = Caption;
                _toggleButton = (ToggleButton)toggleButtonView;
                _toggleButton.SetOnCheckedChangeListener(null);
                _toggleButton.Checked = Value;
                _toggleButton.SetOnCheckedChangeListener(this);

                if (TextOff != null)
                {
                    _toggleButton.TextOff = TextOff;
                    if (!Value)
                        _toggleButton.Text = TextOff;
                }

                if (TextOn != null)
                {
                    _toggleButton.TextOn = TextOn;
                    if (Value)
                        _toggleButton.Text = TextOn;
                }
            }
            return view;
        }
开发者ID:sam-lippert,项目名称:Android.Dialog,代码行数:29,代码来源:BooleanElement.cs

示例2: OnCreate

		/*
     * (non-Javadoc)
     *
     * @see android.app.Activity#onCreate(android.os.Bundle)
     */
		protected override void OnCreate (Bundle bundle)
		{
			if (Intent != null) {
				Bundle extras = Intent.Extras;
				if (extras != null) {
					int theme = extras.GetInt ("theme");
					if (theme != 0) {
						SetTheme (theme);
					}
				}
			}
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.Main);

			holoCircularProgressBar = FindViewById<LibraryHoloCircularProgressBar.HoloCircularProgressBar> (Resource.Id.holoCircularProgressBar);

			btnRandomColor = FindViewById<Button> (Resource.Id.btnRandomColor);
			btnRandomColor.Click += (object sender, EventArgs e) => {
				SwitchColor ();
			};
			btnZero = FindViewById<Button> (Resource.Id.btnZero);
			btnZero.Click += (object sender, EventArgs e) => {
				if (_progressBarAnimator != null) {
					_progressBarAnimator.Cancel ();
				}
				Animate (holoCircularProgressBar, null, 0f, 1000);
				holoCircularProgressBar.SetMarkerProgress (0f);
			};
			btnOne = FindViewById<Button> (Resource.Id.btnOne);
			btnOne.Click += (object sender, EventArgs e) => {
				if (_progressBarAnimator != null) {
					_progressBarAnimator.Cancel ();
				}
				Animate (holoCircularProgressBar, null, 1f, 1000);
				holoCircularProgressBar.SetMarkerProgress (1f);
			};
			togAnimation = FindViewById<ToggleButton> (Resource.Id.togAnimation);
			togAnimation.SetOnCheckedChangeListener (this);
		}
开发者ID:jeedey93,项目名称:xamarin-android-samples,代码行数:44,代码来源:MainActivity.cs


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