public void Bind(Rule contentItem, UIAlertRulesTableView parent)
        {
            _parent = parent;
            lblRuleName.Text = contentItem.RuleName;
            lblMobile.Text = "Send Mobile: " + contentItem.SendMobile;
            lblSearchTerm.Text = contentItem.SearchTerm;
            lblSendDash.Text = "Send Dash:" + contentItem.SendDashboard;
            lblSendEmail.Text = "Send Email: " + contentItem.SendEmail;
            lblSendText.Text = "Send Text: " + contentItem.SendText;

            btnDelete.SetImage (UIImage.FromFile ("images/icons/delete.png"), UIControlState.Normal);
            btnDelete.TouchUpInside += (object sender, EventArgs e) => {
                _parent.DeleteItem(_contentItem);
            };

            _contentItem = contentItem;
        }
        void Layout()
        {
            if (_tableView == null) {
                _tableView = new UIAlertRulesTableView ();
                var t = this.Frame;
                _tableView.Frame = new RectangleF (0, 0, UIScreen.MainScreen.ApplicationFrame.Width, UIScreen.MainScreen.ApplicationFrame.Height - 44); // 44 is height of nav bar
                //				_tableView.ScrollEnabled = false;
                _tableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
                _tableView.BackgroundColor = UIColor.FromRGB (242, 242, 242); //UIColor.FromPatternImage (UIImage.FromFile("images/login/loginBg.png"));

                // add a swipe handler for options
                var s = new UISwipeGestureRecognizer (SwipeHandler);
                s.Direction = UISwipeGestureRecognizerDirection.Left;
                _tableView.AddGestureRecognizer (s);
                s = new UISwipeGestureRecognizer (SwipeHandler);
                s.Direction = UISwipeGestureRecognizerDirection.Right;
                _tableView.AddGestureRecognizer (s);

                // wure up the remove row
                _tableView.DeleteItem = (item) => {

                    var alert = MBAlertView.AlertWithBody ("Are you sure you want to delete this rule? You cannot undo this.", "No", null);
                    alert.AddButtonWithText ("Yes", MBAlertViewItemType.Destructive, () => {
                        // call server to delete the tweet
                        Helper.Default.ShowHud("deleting ...");
                        Api.Default.DeleteAlertRule (item, (result) => {
                            this.InvokeOnMainThread(()=>{
                                if (result.Result == "ok") {
                                    var index = this.ViewSource.RemoveItem (item);
                                    this._tableView.DeleteRows (new MonoTouch.Foundation.NSIndexPath[]{MonoTouch.Foundation.NSIndexPath.Create (0,index)}, UITableViewRowAnimation.Fade);
                                    Helper.Default.HideHud();
                                }
                                else{
                                    Helper.Default.HideHud("Could not delete, try again.");
                                }
                            });
                        });
                    });
                    alert.AddToDisplayQueue ();
                };

                // add to view
                this.AddSubview (_tableView);
            }
        }