[MonoTouch] Custom RootElement showing up blank
brinew27
briannewton at gmail.com
Fri Oct 14 18:49:48 EDT 2011
That does, thanks Jeff. I'll take a look at that code when I get home,
I'm assuming I'll have to add code to the getcell override to populate
the cell with the caption.
On Fri, Oct 14, 2011 at 9:20 AM, Jeff Stedfast [via MonoTouch]
<ml-node+s2284126n3905415h37 at n4.nabble.com> wrote:
> Hi Brian,
> By overriding RootElement's GetCell(), RootElement doesn't get a chance to
> populate the cell's fields.
> Hope that helps,
> Jeff
> On Thu, Oct 13, 2011 at 11:53 PM, brinew27 <[hidden email]> wrote:
>>
>> Hey guys,
>>
>> Any idea why this code would produce a blank rootelement in my table when
>> passing in an Alert object and a string, when if I just use a basic
>> RootElement and pass a string for caption it works fine?
>>
>> public class AlertRootElement : RootElement {
>> static NSString key = new NSString ("alertRootElement");
>> public EbayNotifierService.Alert Alert;
>>
>> public AlertRootElement (EbayNotifierService.Alert alert,
>> string
>> caption) : base (caption)
>> {
>> Alert = alert;
>> }
>>
>> public override UITableViewCell GetCell (UITableView tv)
>> {
>> var cell = tv.DequeueReusableCell (key) as AlertDataCell;
>> if (cell == null)
>> cell = new AlertDataCell (Alert, key);
>> else
>> cell.UpdateCell (Alert);
>> return cell;
>> }
>>
>> public void Delete() {
>> Console.WriteLine(String.Format("Deleting record {0}",
>> Alert));
>>
>> EbayNotifierService.EbayNotifier
>> ebayNotifierService = new
>> EbayNotifierService.EbayNotifier();
>>
>> ebayNotifierService.DeactivateAlertAndItems(Alert.AlertID);
>> }
>> }
>>
>> --
>> View this message in context:
>> http://monotouch.2284126.n4.nabble.com/Custom-RootElement-showing-up-blank-tp3903751p3903751.html
>> Sent from the MonoTouch mailing list archive at Nabble.com.
>> _______________________________________________
>> MonoTouch mailing list
>> [hidden email]
>> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://monotouch.2284126.n4.nabble.com/Custom-RootElement-showing-up-blank-tp3903751p3905415.html
> To unsubscribe from Custom RootElement showing up blank, click here.
--
View this message in context: http://monotouch.2284126.n4.nabble.com/Custom-RootElement-showing-up-blank-tp3903751p3906438.html
Sent from the MonoTouch mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111014/8039439c/attachment-0001.html
More information about the MonoTouch
mailing list