本文整理汇总了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;
}
示例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);
}