Ravindra
Ravindra

Reputation: 21

CheckboxElement with Subtitle using MonoTouch.Dialog

I am new to iPhone development. I am using Monotouch.Dialog for iPhone application.

We can create a StyledStringElement that shows a Subtitle.

I would like to show a CheckboxElement with subtitle. Is that possible?

Thanks in advance.

Upvotes: 2

Views: 771

Answers (1)

poupou
poupou

Reputation: 43553

Yes, you will have to either:

(a) inherit either StyledStringElement or CheckboxElement and copy-paste the required code from the other one. Useful if you need many of such elements in your application.

(b) directly add some code in the element (in case you only need one of them), like:

var checked_styled_element = new StyledStringElement ("Checked", "value");
checked_styled_element.Tapped += () => {
    checked_styled_element.Accessory = (checked_styled_element.Accessory == UITableViewCellAccessory.Checkmark) ? UITableViewCellAccessory.None : UITableViewCellAccessory.Checkmark;
    checked_styled_element.GetImmediateRootElement ().Reload (checked_styled_element, UITableViewRowAnimation.None);
};

Upvotes: 3

Related Questions