public TaskMemberForm(ProjectModel project, TaskModel task) : base() { AddView(new BoxView { BackgroundColor = Color.Green }); var form = new StackLayout { Padding = new Thickness(15) }; var title = new Label { Text = "ADD MEMBER", VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = 25 }; form.Children.Add(title); TableSection members; var table = new TableView { Intent = TableIntent.Form, Root = new TableRoot() { (members = new TableSection() { }) } }; var list = new List <UserModel> (project.Members); foreach (var m in task.Members) { list.Remove(m); } foreach (var m in list) { members.Add(new TextCell { Text = m.Email, Command = new Command(() => SelectMember(m)) }); } form.Children.Add(table); var buttons = new BaseRelativeLayout(); var cancelButton = ButtonFactory.Make("Cancel"); cancelButton.HorizontalOptions = LayoutOptions.CenterAndExpand; cancelButton.Clicked += (sender, e) => Cancel(); buttons.AddView(cancelButton, 0.5, 0, 0.47, 40); form.Children.Add(buttons); AddView(form); }
public TaskForm() : base() { AddView(new BoxView { BackgroundColor = Color.Green }); var form = new StackLayout { Padding = new Thickness(15) }; var title = new Label { Text = "CREATE TASK", VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = 25 }; form.Children.Add(title); var fields = new StackLayout { Padding = new Thickness(15, 7), VerticalOptions = LayoutOptions.CenterAndExpand }; titleEntry = new Entry { Placeholder = "Title", Keyboard = Keyboard.Create(KeyboardFlags.CapitalizeSentence) }; descriptionEntry = new Entry { Placeholder = "Description" }; titleEntry.Completed += (sender, e) => descriptionEntry.Focus(); descriptionEntry.Completed += (sender, e) => Submit(); fields.Children.Add(titleEntry); fields.Children.Add(descriptionEntry); form.Children.Add(fields); var buttons = new BaseRelativeLayout(); var cancelButton = ButtonFactory.Make("Cancel"); cancelButton.HorizontalOptions = LayoutOptions.CenterAndExpand; cancelButton.Clicked += (sender, e) => Cancel(); buttons.AddView(cancelButton, 0.25, 0, 0.47, 40); var submitButton = ButtonFactory.Make("Create"); submitButton.HorizontalOptions = LayoutOptions.CenterAndExpand; submitButton.Clicked += (sender, e) => Submit(); buttons.AddView(submitButton, 0.75, 0, 0.47, 40); form.Children.Add(buttons); AddView(form); }
public LoginForm() : base() { AddView(new BoxView { BackgroundColor = Color.Green }); var form = new StackLayout { Padding = new Thickness(15) }; var title = new Label { Text = "LOG IN", VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = 25 }; form.Children.Add(title); var fields = new StackLayout { Padding = new Thickness(15, 7), VerticalOptions = LayoutOptions.CenterAndExpand }; emailEntry = new Entry { Placeholder = "email", Keyboard = Keyboard.Email }; passwordEntry = new Entry { Placeholder = "password", IsPassword = true }; emailEntry.Completed += (sender, e) => passwordEntry.Focus(); passwordEntry.Completed += (sender, e) => Submit(); fields.Children.Add(emailEntry); fields.Children.Add(passwordEntry); form.Children.Add(fields); var buttons = new BaseRelativeLayout(); var cancelButton = ButtonFactory.Make("Cancel"); cancelButton.HorizontalOptions = LayoutOptions.CenterAndExpand; cancelButton.Clicked += (sender, e) => Cancel(); buttons.AddView(cancelButton, 0.25, 0, 0.47, 40); var submitButton = ButtonFactory.Make("Log in"); submitButton.HorizontalOptions = LayoutOptions.CenterAndExpand; submitButton.Clicked += (sender, e) => Submit(); buttons.AddView(submitButton, 0.75, 0, 0.47, 40); form.Children.Add(buttons); AddView(form); }
public InvitationForm(ProjectModel project) : base() { AddView(new BoxView { BackgroundColor = Color.Green }); var form = new StackLayout { Padding = new Thickness(15) }; var title = new Label { Text = "INVITE USER TO " + project.Name, VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = 25 }; form.Children.Add(title); var fields = new StackLayout { Padding = new Thickness(15, 7), VerticalOptions = LayoutOptions.CenterAndExpand }; emailEntry = new Entry { Placeholder = "Email", Keyboard = Keyboard.Email }; emailEntry.Completed += (sender, e) => Submit(); fields.Children.Add(emailEntry); form.Children.Add(fields); var buttons = new BaseRelativeLayout(); var cancelButton = ButtonFactory.Make("Cancel"); cancelButton.HorizontalOptions = LayoutOptions.CenterAndExpand; cancelButton.Clicked += (sender, e) => Cancel(); buttons.AddView(cancelButton, 0.25, 0, 0.47, 40); var submitButton = ButtonFactory.Make("Invite"); submitButton.HorizontalOptions = LayoutOptions.CenterAndExpand; submitButton.Clicked += (sender, e) => Submit(); buttons.AddView(submitButton, 0.75, 0, 0.47, 40); form.Children.Add(buttons); AddView(form); }