6 namespace MonoDroid.Dialog
20 if (ValueChanged != null)
28 public BoolElement(
string caption,
bool value) : base(caption)
34 : base(caption, layoutId)
41 return _val ?
"On" :
"Off";
50 private ToggleButton _toggleButton;
51 private TextView _caption;
52 private TextView _subCaption;
55 : base(caption, value, (int)
DroidResources.ElementLayout.dialog_onofffieldright)
60 : base(caption, value, layoutId)
64 public override View
GetView(Context context, View convertView, ViewGroup parent)
66 View toggleButtonView;
67 View view = DroidResources.LoadBooleanElementLayout(context, convertView, parent, LayoutId, out _caption, out _subCaption, out toggleButtonView);
71 _caption.Text = Caption;
72 _toggleButton = toggleButtonView as ToggleButton;
73 _toggleButton.SetOnCheckedChangeListener(null);
74 _toggleButton.Checked = Value;
75 _toggleButton.SetOnCheckedChangeListener(
this);
80 protected override void Dispose(
bool disposing)
93 this.Value = isChecked;
override void Dispose(bool disposing)
Used to display toggle button on the screen.
BooleanElement(string caption, bool value)
override string Summary()
Returns a summary of the value represented by this object, suitable for rendering as the result of a ...
void OnCheckedChanged(CompoundButton buttonView, bool isChecked)
override View GetView(Context context, View convertView, ViewGroup parent)
Overriden my most derived classes, creates a view that creates a View with the contents for display ...
BoolElement(string caption, bool value)
EventHandler ValueChanged
BoolElement(string caption, bool value, int layoutId)
BooleanElement(string caption, bool value, int layoutId)