public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            var model = _filterController.Filter.Clone();

            var save = new StringElement("Save as Default") { Accessory = UITableViewCellAccessory.None };
            save.Clicked.Subscribe(_ =>
            {
                _filterController.ApplyFilter(CreateFilterModel(), true);
                CloseViewController();
            });

            //Load the root
            var root = new [] {
                new Section("Filter") {
                    (_open = new BooleanElement("Open?", model.Open)),
                    (_labels = new EntryElement("Labels", "bug,ui,@user", model.Labels) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),
                    (_mentioned = new EntryElement("Mentioned", "User", model.Mentioned) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),
                    (_creator = new EntryElement("Creator", "User", model.Creator) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),
                    (_assignee = new EntryElement("Assignee", "User", model.Assignee) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),
                    (_milestone = new StringElement("Milestone", "None", UITableViewCellStyle.Value1)),
                },
                new Section("Order By") {
                    (_sort = CreateEnumElement("Field", model.SortType)),
                    (_asc = new BooleanElement("Ascending", model.Ascending))
                },
                new Section(string.Empty, "Saving this filter as a default will save it only for this repository.") {
                    save
                }
            };

            RefreshMilestone();

            _milestone.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            _milestone.Clicked.Subscribe(_ => {
                var ctrl = new IssueMilestonesFilterViewController(_user, _repo, _milestoneHolder != null);

                ctrl.MilestoneSelected = (title, num, val) => {
                    if (title == null && num == null && val == null)
                        _milestoneHolder = null;
                    else
                        _milestoneHolder = new IssuesFilterModel.MilestoneKeyValue { Name = title, Value = val, IsMilestone = num.HasValue };
                    RefreshMilestone();
                    NavigationController.PopViewController(true);
                };
                NavigationController.PushViewController(ctrl, true);
            });

            Root.Reset(root);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            var model = _filterController.Filter.Clone();

            var save = new StringElement("Save as Default")
            {
                Accessory = UITableViewCellAccessory.None
            };

            save.Clicked.Subscribe(_ =>
            {
                _filterController.ApplyFilter(CreateFilterModel(), true);
                CloseViewController();
            });

            //Load the root
            var root = new [] {
                new Section("Filter")
                {
                    (_open = new BooleanElement("Open?", model.Open)),
                    (_labels = new EntryElement("Labels", "bug,ui,@user", model.Labels)
                    {
                        TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None
                    }),
                    (_mentioned = new EntryElement("Mentioned", "User", model.Mentioned)
                    {
                        TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None
                    }),
                    (_creator = new EntryElement("Creator", "User", model.Creator)
                    {
                        TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None
                    }),
                    (_assignee = new EntryElement("Assignee", "User", model.Assignee)
                    {
                        TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None
                    }),
                    (_milestone = new StringElement("Milestone", "None", UITableViewCellStyle.Value1)),
                },
                new Section("Order By")
                {
                    (_sort = CreateEnumElement("Field", model.SortType)),
                    (_asc = new BooleanElement("Ascending", model.Ascending))
                },
                new Section(string.Empty, "Saving this filter as a default will save it only for this repository.")
                {
                    save
                }
            };

            RefreshMilestone();

            _milestone.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            _milestone.Clicked.Subscribe(_ => {
                var ctrl = new IssueMilestonesFilterViewController(_user, _repo, _milestoneHolder != null);

                ctrl.MilestoneSelected = (title, num, val) => {
                    if (title == null && num == null && val == null)
                    {
                        _milestoneHolder = null;
                    }
                    else
                    {
                        _milestoneHolder = new IssuesFilterModel.MilestoneKeyValue {
                            Name = title, Value = val, IsMilestone = num.HasValue
                        }
                    };
                    RefreshMilestone();
                    NavigationController.PopViewController(true);
                };
                NavigationController.PushViewController(ctrl, true);
            });

            Root.Reset(root);
        }
    }