Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit eb488a5

Browse files
committed
Updates to CodeFramework
1 parent 53453a3 commit eb488a5

File tree

2 files changed

+80
-80
lines changed

2 files changed

+80
-80
lines changed

CodeHub.iOS/Views/Issues/IssueEditView.cs

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -8,93 +8,93 @@
88
using CodeFramework.iOS.Utils;
99
using CodeHub.iOS.ViewControllers;
1010

11-
namespace CodeHub.iOS.Views.Issues
12-
{
13-
public class IssueEditView : ViewModelDrivenDialogViewController
11+
namespace CodeHub.iOS.Views.Issues
12+
{
13+
public class IssueEditView : ViewModelDrivenDialogViewController
1414
{
15-
private IHud _hud;
15+
private IHud _hud;
1616

17-
public override void ViewDidLoad()
18-
{
19-
Title = "Edit Issue";
17+
public override void ViewDidLoad()
18+
{
19+
Title = "Edit Issue";
2020

21-
base.ViewDidLoad();
21+
base.ViewDidLoad();
2222

23-
_hud = this.CreateHud();
24-
var vm = (IssueEditViewModel)ViewModel;
23+
_hud = this.CreateHud();
24+
var vm = (IssueEditViewModel)ViewModel;
2525

26-
NavigationItem.RightBarButtonItem = new UIBarButtonItem(Theme.CurrentTheme.SaveButton, UIBarButtonItemStyle.Plain, (s, e) => {
27-
View.EndEditing(true);
28-
vm.SaveCommand.Execute(null);
29-
});
26+
NavigationItem.RightBarButtonItem = new UIBarButtonItem(Theme.CurrentTheme.SaveButton, UIBarButtonItemStyle.Plain, (s, e) => {
27+
View.EndEditing(true);
28+
vm.SaveCommand.Execute(null);
29+
});
3030

31-
var title = new InputElement("Title", string.Empty, string.Empty);
32-
title.Changed += (object sender, EventArgs e) => vm.Title = title.Value;
31+
var title = new InputElement("Title", string.Empty, string.Empty);
32+
title.Changed += (object sender, EventArgs e) => vm.Title = title.Value;
3333

34-
var assignedTo = new StyledStringElement("Responsible", "Unassigned", UITableViewCellStyle.Value1);
35-
assignedTo.Accessory = UITableViewCellAccessory.DisclosureIndicator;
36-
assignedTo.Tapped += () => vm.GoToAssigneeCommand.Execute(null);
34+
var assignedTo = new StyledStringElement("Responsible", "Unassigned", UITableViewCellStyle.Value1);
35+
assignedTo.Accessory = UITableViewCellAccessory.DisclosureIndicator;
36+
assignedTo.Tapped += () => vm.GoToAssigneeCommand.Execute(null);
3737

38-
var milestone = new StyledStringElement("Milestone".t(), "None", UITableViewCellStyle.Value1);
39-
milestone.Accessory = UITableViewCellAccessory.DisclosureIndicator;
40-
milestone.Tapped += () => vm.GoToMilestonesCommand.Execute(null);
38+
var milestone = new StyledStringElement("Milestone".t(), "None", UITableViewCellStyle.Value1);
39+
milestone.Accessory = UITableViewCellAccessory.DisclosureIndicator;
40+
milestone.Tapped += () => vm.GoToMilestonesCommand.Execute(null);
4141

42-
var labels = new StyledStringElement("Labels".t(), "None", UITableViewCellStyle.Value1);
43-
labels.Accessory = UITableViewCellAccessory.DisclosureIndicator;
44-
labels.Tapped += () => vm.GoToLabelsCommand.Execute(null);
42+
var labels = new StyledStringElement("Labels".t(), "None", UITableViewCellStyle.Value1);
43+
labels.Accessory = UITableViewCellAccessory.DisclosureIndicator;
44+
labels.Tapped += () => vm.GoToLabelsCommand.Execute(null);
4545

46-
var content = new MultilinedElement("Description");
47-
content.Tapped += () =>
48-
{
46+
var content = new MultilinedElement("Description");
47+
content.Tapped += () =>
48+
{
4949
var composer = new MarkdownComposerViewController { Title = "Issue Description", Text = content.Value };
50-
composer.NewComment(this, (text) => {
51-
vm.Content = text;
52-
composer.CloseComposer();
53-
});
54-
};
55-
56-
var state = new TrueFalseElement("Open", true);
57-
state.ValueChanged += (sender, e) => vm.IsOpen = state.Value;
58-
59-
vm.Bind(x => x.Title, x => title.Value = x, true);
60-
61-
vm.Bind(x => x.Content, x => content.Value = x, true);
62-
63-
vm.Bind(x => x.AssignedTo, x => {
64-
assignedTo.Value = x == null ? "Unassigned" : x.Login;
65-
if (assignedTo.GetImmediateRootElement() != null)
66-
Root.Reload(assignedTo, UITableViewRowAnimation.None);
67-
}, true);
68-
69-
vm.Bind(x => x.Milestone, x => {
70-
milestone.Value = x == null ? "None" : x.Title;
71-
if (assignedTo.GetImmediateRootElement() != null)
72-
Root.Reload(milestone, UITableViewRowAnimation.None);
73-
}, true);
74-
75-
vm.BindCollection(x => x.Labels, x => {
76-
labels.Value = vm.Labels.Items.Count == 0 ? "None" : string.Join(", ", vm.Labels.Items.Select(i => i.Name));
77-
if (assignedTo.GetImmediateRootElement() != null)
78-
Root.Reload(labels, UITableViewRowAnimation.None);
79-
}, true);
80-
81-
vm.Bind(x => x.IsOpen, x =>
82-
{
83-
state.Value = x;
84-
if (assignedTo.GetImmediateRootElement() != null)
85-
Root.Reload(state, UITableViewRowAnimation.None);
86-
}, true);
87-
88-
vm.Bind(x => x.IsSaving, x =>
89-
{
90-
if (x)
91-
_hud.Show("Updating...");
92-
else
93-
_hud.Hide();
94-
});
95-
96-
Root = new RootElement(Title) { new Section { title, assignedTo, milestone, labels }, new Section { state }, new Section { content } };
97-
}
98-
}
99-
}
100-
50+
composer.NewComment(this, (text) => {
51+
vm.Content = text;
52+
composer.CloseComposer();
53+
});
54+
};
55+
56+
var state = new TrueFalseElement("Open", true);
57+
state.ValueChanged += (sender, e) => vm.IsOpen = state.Value;
58+
59+
vm.Bind(x => x.Title, x => title.Value = x, true);
60+
61+
vm.Bind(x => x.Content, x => content.Value = x, true);
62+
63+
vm.Bind(x => x.AssignedTo, x => {
64+
assignedTo.Value = x == null ? "Unassigned" : x.Login;
65+
if (assignedTo.GetImmediateRootElement() != null)
66+
Root.Reload(assignedTo, UITableViewRowAnimation.None);
67+
}, true);
68+
69+
vm.Bind(x => x.Milestone, x => {
70+
milestone.Value = x == null ? "None" : x.Title;
71+
if (assignedTo.GetImmediateRootElement() != null)
72+
Root.Reload(milestone, UITableViewRowAnimation.None);
73+
}, true);
74+
75+
vm.BindCollection(x => x.Labels, x => {
76+
labels.Value = vm.Labels.Items.Count == 0 ? "None" : string.Join(", ", vm.Labels.Items.Select(i => i.Name));
77+
if (assignedTo.GetImmediateRootElement() != null)
78+
Root.Reload(labels, UITableViewRowAnimation.None);
79+
}, true);
80+
81+
vm.Bind(x => x.IsOpen, x =>
82+
{
83+
state.Value = x;
84+
if (assignedTo.GetImmediateRootElement() != null)
85+
Root.Reload(state, UITableViewRowAnimation.None);
86+
}, true);
87+
88+
vm.Bind(x => x.IsSaving, x =>
89+
{
90+
if (x)
91+
_hud.Show("Updating...");
92+
else
93+
_hud.Hide();
94+
});
95+
96+
Root = new RootElement(Title) { new Section { title, assignedTo, milestone, labels }, new Section { state }, new Section { content } };
97+
}
98+
}
99+
}
100+

lib/CodeFramework

0 commit comments

Comments
 (0)