public override void ViewDidLoad() { base.ViewDidLoad(); var vm = (IssueMilestonesViewModel)ViewModel; BindCollection(vm.Milestones, x => { var e = new MilestoneElement(x); e.Tapped += () => { if (vm.SelectedMilestone != null && string.Equals(vm.SelectedMilestone, x.Name)) vm.SelectedMilestone = null; else vm.SelectedMilestone = x.Name; }; if (vm.SelectedMilestone != null && string.Equals(vm.SelectedMilestone, x.Name)) e.Accessory = UITableViewCellAccessory.Checkmark; return e; }); vm.Bind(x => x.SelectedMilestone, x => { if (Root.Count == 0) return; foreach (var m in Root[0].Elements.Cast<MilestoneElement>()) m.Accessory = (x != null && string.Equals(m.Milestone.Name, x)) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; Root.Reload(Root[0], UITableViewRowAnimation.None); }); var _hud = new Hud(View); vm.Bind(x => x.IsSaving, x => { if (x) _hud.Show("Saving..."); else _hud.Hide(); }); }
private static IChart MilestoneChart() { var chart = (GanttChart)ChartHasDataTable(); // var task = chart.Tasks.TaskElements[4]; var task = chart.Tasks[4]; var milestone = new MilestoneElement { TaskId = task.Id, Date = task.End.Value, ToolText = "Development Complete", Color = Color.Red }; // chart.Milestones.MilestoneElements.Add(milestone); chart.Milestones.Add(milestone); // task = chart.Tasks.TaskElements[6]; task = chart.Tasks[6]; milestone = new MilestoneElement { TaskId = task.Id, Date = task.End.Value, ToolText = "Successful Global Release", Color = Color.DarkBlue }; // chart.Milestones.MilestoneElements.Add(milestone); chart.Milestones.Add(milestone); return(chart); }
public override void ViewDidLoad() { base.ViewDidLoad(); var vm = (IssueMilestonesViewModel)ViewModel; BindCollection(vm.Milestones, x => { var e = new MilestoneElement(x); e.Tapped += () => { if (vm.SelectedMilestone != null && vm.SelectedMilestone.Number == x.Number) vm.SelectedMilestone = null; else vm.SelectedMilestone = x; }; if (vm.SelectedMilestone != null && vm.SelectedMilestone.Number == x.Number) e.Accessory = UITableViewCellAccessory.Checkmark; return e; }); vm.Bind(x => x.SelectedMilestone, x => { if (Root.Count == 0) return; foreach (var m in Root[0].Elements.Cast<MilestoneElement>()) m.Accessory = (x != null && m.Milestone.Number == x.Number) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; Root.Reload(Root[0], UITableViewRowAnimation.None); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); var vm = (IssueMilestonesViewModel)ViewModel; BindCollection(vm.Milestones, x => { var e = new MilestoneElement(x); e.Tapped += () => { if (vm.SelectedMilestone != null && string.Equals(vm.SelectedMilestone, x.Name)) { vm.SelectedMilestone = null; } else { vm.SelectedMilestone = x.Name; } }; if (vm.SelectedMilestone != null && string.Equals(vm.SelectedMilestone, x.Name)) { e.Accessory = UITableViewCellAccessory.Checkmark; } return(e); }); vm.Bind(x => x.SelectedMilestone, x => { if (Root.Count == 0) { return; } foreach (var m in Root[0].Elements.Cast <MilestoneElement>()) { m.Accessory = (x != null && string.Equals(m.Milestone.Name, x)) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } Root.Reload(Root[0], UITableViewRowAnimation.None); }); var _hud = new Hud(View); vm.Bind(x => x.IsSaving, x => { if (x) { _hud.Show("Saving..."); } else { _hud.Hide(); } }); }
public override void ViewDidLoad() { base.ViewDidLoad(); TableView.RowHeight = 80f; TableView.SeparatorInset = new UIEdgeInsets(0, 0, 0, 0); var vm = (IssueMilestonesViewModel)ViewModel; BindCollection(vm.Milestones, x => { var e = new MilestoneElement(x.Number, x.Title, x.OpenIssues, x.ClosedIssues, x.DueOn); e.Tapped += () => { if (vm.SelectedMilestone != null && vm.SelectedMilestone.Number == x.Number) { vm.SelectedMilestone = null; } else { vm.SelectedMilestone = x; } }; if (vm.SelectedMilestone != null && vm.SelectedMilestone.Number == x.Number) { e.Accessory = UITableViewCellAccessory.Checkmark; } return(e); }); vm.Bind(x => x.SelectedMilestone).Subscribe(x => { if (Root.Count == 0) { return; } foreach (var m in Root[0].Elements.Cast <MilestoneElement>()) { m.Accessory = (x != null && m.Number == x.Number) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } }); vm.Bind(x => x.IsSaving).SubscribeStatus("Saving..."); }
public override void ViewDidLoad() { base.ViewDidLoad(); TableView.RowHeight = 80f; TableView.SeparatorInset = new UIEdgeInsets(0, 0, 0, 0); this.BindList(ViewModel.Milestones, x => { var e = new MilestoneElement(x); e.Tapped += () => { if (ViewModel.SelectedMilestone != null && ViewModel.SelectedMilestone.Number == x.Number) { ViewModel.SelectedMilestone = null; } else { ViewModel.SelectedMilestone = x; } }; if (ViewModel.SelectedMilestone != null && ViewModel.SelectedMilestone.Number == x.Number) { e.Accessory = UITableViewCellAccessory.Checkmark; } return(e); }); ViewModel.WhenAnyValue(x => x.SelectedMilestone).Where(x => x != null).Subscribe(x => { if (Root.Count == 0) { return; } foreach (var m in Root[0].Cast <MilestoneElement>()) { m.Accessory = (x != null && m.Milestone.Number == x.Number) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } Root.Reload(Root[0], UITableViewRowAnimation.None); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); var vm = (IssueMilestonesViewModel)ViewModel; BindCollection(vm.Milestones, x => { var e = new MilestoneElement(x); e.Clicked.Subscribe(_ => { if (vm.SelectedMilestone != null && string.Equals(vm.SelectedMilestone, x.Name)) { vm.SelectedMilestone = null; } else { vm.SelectedMilestone = x.Name; } }); if (vm.SelectedMilestone != null && string.Equals(vm.SelectedMilestone, x.Name)) { e.Accessory = UITableViewCellAccessory.Checkmark; } return(e); }); vm.Bind(x => x.SelectedMilestone).Subscribe(x => { var elements = Root.FirstOrDefault()?.Elements ?? Enumerable.Empty <Element>(); foreach (var m in elements.Cast <MilestoneElement>()) { m.Accessory = (x != null && string.Equals(m.Milestone.Name, x)) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } }); OnActivation(d => d(vm.Bind(x => x.IsSaving).SubscribeStatus("Saving..."))); }