Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Create your own <code>RadioElement</code> like:</p> <pre><code>class MyRadioElement : RadioElement { public MyRadioElement (string s) : base (s) {} public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path) { base.Selected (dvc, tableView, path); var selected = OnSelected; if (selected != null) selected (this, EventArgs.Empty); } static public event EventHandler&lt;EventArgs&gt; OnSelected; } </code></pre> <p><em>note: do not use a static event if you want to have more than one radio group</em></p> <p>Then create a <code>RootElement</code> that use this new type, like:</p> <pre><code> RootElement CreateRoot () { StringElement se = new StringElement (String.Empty); MyRadioElement.OnSelected += delegate(object sender, EventArgs e) { se.Caption = (sender as MyRadioElement).Caption; var root = se.GetImmediateRootElement (); root.Reload (se, UITableViewRowAnimation.Fade); }; return new RootElement (String.Empty, new RadioGroup (0)) { new Section ("Dr. Who ?") { new MyRadioElement ("Dr. House"), new MyRadioElement ("Dr. Zhivago"), new MyRadioElement ("Dr. Moreau") }, new Section ("Winner") { se } }; } </code></pre> <p>[UPDATE]</p> <p>Here is a more modern version of this RadioElement:</p> <pre><code>public class DebugRadioElement : RadioElement { Action&lt;DebugRadioElement, EventArgs&gt; onCLick; public DebugRadioElement (string s, Action&lt;DebugRadioElement, EventArgs&gt; onCLick) : base (s) { this.onCLick = onCLick; } public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path) { base.Selected (dvc, tableView, path); var selected = onCLick; if (selected != null) selected (this, EventArgs.Empty); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload