public override void UpdateSelected() { Cell.AccessoryView = null; Cell.Accessory = (bool)DataContext ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; Cell.TextLabel.Text = Caption; var containsItem = false; if (Container != null) { containsItem = Container.SelectedItems.Contains(Item); if ((bool)DataContext && !containsItem) { Container.SelectedItems.Add(Item); Container.SelectedItem = Item; } if (!(bool)DataContext && containsItem) { Container.SelectedItems.Remove(Item); } var enumBinder = Item as EnumItem; if (enumBinder != null) { enumBinder.IsChecked = (bool)DataContext; Root.DataContext = Container.SelectedItems.Count.ToString(); } var property = BindableProperty.GetBindableProperty(Container, "SelectedItemProperty"); if (property != null) { property.Update(); } property = BindableProperty.GetBindableProperty(Container, "SelectedItemsProperty"); if (property != null) { property.Update(); } property = BindableProperty.GetBindableProperty(Root, "DataContextProperty"); if (property != null) { property.Update(); } property = BindableProperty.GetBindableProperty(Container, "IndexProperty"); if (property != null) { property.Update(); } } }
public void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath indexPath) { if (Parent != null) { var root = (IRoot)Parent.Parent; if (root != null) { var radioGroup = root.Groups.FirstOrDefault() as RadioGroup; var section = root.Sections[indexPath.Section]; var index = 0; foreach (var e in section.Elements) { var radioView = e as RadioElement; UpdateSelected(radioView, this == radioView); if (this == radioView && radioGroup != null) { radioGroup.Selected = index; } index++; } root.Value = this.Caption; var property = BindableProperty.GetBindableProperty(root, "ValueProperty"); property.Update(); property = BindableProperty.GetBindableProperty(root, "ItemIndexProperty"); // property.Update(); if (radioGroup != null) { root.ItemIndex = radioGroup.Selected; } } } Value = true; UpdateSelected(); if (PopOnSelect) { dvc.NavigationController.PopViewControllerAnimated(true); } }
public void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath indexPath) { if (Parent != null) { if (Root != null) { var section = Root.Sections[indexPath.Section]; var selectedIndex = -1; var index = 0; if (Container != null) { Container.SelectedItems.Clear(); foreach (var e in section.Elements) { var radioView = e as RadioElement; UpdateSelected(radioView, this == radioView); if (this == radioView) { selectedIndex = index; Container.SelectedItem = Item; Container.SelectedItems.Add(Item); } index++; } } Root.Index = selectedIndex; var property = BindableProperty.GetBindableProperty(Container, "SelectedItemProperty"); if (property != null) { property.Update(); } property = BindableProperty.GetBindableProperty(Container, "SelectedItemsProperty"); if (property != null) { property.Update(); } property = BindableProperty.GetBindableProperty(Container, "IndexProperty"); property.Update(); property = BindableProperty.GetBindableProperty(Root, "DataContextProperty"); if (property != null) { property.Update(Caption); } } } DataContext = true; UpdateSelected(); if (PopOnSelect) { dvc.NavigationController.PopViewControllerAnimated(true); } }