Beispiel #1
0
        public TaskListFragment(ProjectModel project, string listName)
        {
            this.project  = project;
            this.listName = listName;

            BackgroundColor = Color.White;

            var template = new DataTemplate(typeof(TextCell));

            template.SetBinding(TextCell.TextProperty, "Title");

            list = new ListView {
                ItemsSource    = project.GetList(listName),
                SeparatorColor = Color.Gray,
                ItemTemplate   = template
            };
            list.ItemSelected += async(sender, e) => await TaskSelected(sender as ListView);

            list.RefreshCommand = new Command(() => RefreshList());

            Content.AddView(list, 0, 0, 1, 1);

            var addTaskButton = ButtonFactory.Make("+");

            addTaskButton.TextColor = Color.White;
            addTaskButton.Clicked  += async(sender, e) => await AddTask();

            Content.AddView(addTaskButton, 0.5, -75, 50, 50);
        }
Beispiel #2
0
        public TaskPage(TaskModel task)
        {
            this.task = task;

            Title = task.Title;
            NavigationPage.SetTitleIcon(this, "bar_icon");
            BackgroundColor = Color.White;

            var table = new TableView {
                Intent = TableIntent.Form,
                Root   = new TableRoot()
                {
                    new TableSection()
                    {
                        new TextCell {
                            Text = task.Description, Detail = "Description"
                        }
                    },
                    new TableSection()
                    {
                    },
                    (members = new TableSection("Members")
                    {
                    })
                }
            };

            Refresh();

            Content.AddView(table, 0, 0, 1, 1);
        }
Beispiel #3
0
        public ProjectListPage()
        {
            Title = "My Projects";
            NavigationPage.SetTitleIcon(this, "bar_icon");
            BackgroundColor = Color.White;

            var template = new DataTemplate(typeof(TextCell));

            template.SetBinding(TextCell.TextProperty, "Name");

            list = new ListView {
                ItemsSource    = App.User.Projects,
                SeparatorColor = Color.Gray,
                ItemTemplate   = template
            };
            list.ItemSelected += async(sender, e) => await ProjectSelected(sender as ListView);

            list.RefreshCommand = new Command(() => RefreshList());

            Content.AddView(list, 0, 0, 1, 1);

            leaveProjectButton           = ButtonFactory.Make("-");
            leaveProjectButton.TextColor = Color.White;
            leaveProjectButton.Clicked  += (sender, e) => LeaveProjectPressed();
            Content.AddView(leaveProjectButton, 0.4, -75, 50, 50);

            addProjectButton           = ButtonFactory.Make("+");
            addProjectButton.TextColor = Color.White;
            addProjectButton.Clicked  += async(sender, e) => await ShowProjectForm();

            Content.AddView(addProjectButton, 0.6, -75, 50, 50);
        }
        public InvitationPage()
        {
            Title = "My Invitations";
            NavigationPage.SetTitleIcon(this, "bar_icon");
            BackgroundColor = Color.White;

            var template = new DataTemplate(typeof(TextCell));

            template.SetBinding(TextCell.TextProperty, "Name");

            list = new ListView {
                ItemsSource    = App.User.PotentialProjects,
                SeparatorColor = Color.Gray,
                ItemTemplate   = template
            };
            list.ItemSelected += async(sender, e) => await ProjectSelected(sender as ListView);

            list.RefreshCommand = new Command(async() => await RefreshList());

            Content.AddView(list, 0, 0, 1, 1);
        }
        public MemberListPage(ProjectModel project)
        {
            this.project = project;

            Title = "Members on " + project.Name;
            NavigationPage.SetTitleIcon(this, "bar_icon");
            BackgroundColor = Color.White;

            var template = new DataTemplate(typeof(TextCell));

            template.SetBinding(TextCell.TextProperty, "Email");

            list = new ListView {
                ItemsSource    = project.Members,
                SeparatorColor = Color.Gray,
                ItemTemplate   = template
            };
            list.ItemSelected  += (sender, e) => ItemSelected(sender as ListView);
            list.RefreshCommand = new Command(async() => await RefreshList());

            Content.AddView(list, 0, 0, 1, 1);
        }
Beispiel #6
0
        public LandingPage()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            BackgroundImage = "landing_bg";

            var buttonGroup = new StackLayout {
                Orientation  = StackOrientation.Vertical,
                WidthRequest = 200
            };

            var loginButton = ButtonFactory.Make("Login");

            loginButton.Clicked += async(sender, e) => await ShowLogin();

            buttonGroup.Children.Add(loginButton);

            var regButton = ButtonFactory.Make("Register");

            regButton.Clicked += async(sender, e) => await ShowRegister();

            buttonGroup.Children.Add(regButton);

            Content.AddView(buttonGroup, 0.5, 0.75, 200);
        }
Beispiel #7
0
        public MasterFragment(RootSessionPage root, Action <Page> PageSelected)
        {
            Title = "Root master";

            this.root            = root;
            PageSelectedCallback = PageSelected;

            LoadCache();

            var template = new DataTemplate(typeof(TextCell));

            template.SetBinding(TextCell.TextProperty, "Title");

            var pageList = new ListView {
                ItemsSource    = cache,
                SeparatorColor = Color.Gray,
                ItemTemplate   = template
            };

            pageList.ItemSelected += (sender, e) => ItemSelected(sender as ListView);
            Content.AddView(pageList, 0, 0, 1);
            pageList.BackgroundColor = Color.White;
            pageList.HeightRequest   = 89;



            template = new DataTemplate(typeof(TextCell));
            template.SetBinding(TextCell.TextProperty, "Text");
            template.SetValue(TextCell.TextColorProperty, Color.Black);

            projectActionList = new ListView {
                ItemsSource = new List <Label> {
                    new Label {
                        Text = "Member list"
                    },
                    new Label {
                        Text = "Invite user to project"
                    }
                },
                SeparatorColor = Color.Gray,
                ItemTemplate   = template
            };
            projectActionList.ItemSelected += async(sender, e) => await ProjectActionSelected(sender as ListView);

            Content.Children.Add(projectActionList,
                                 Constraint.Constant(0),
                                 Constraint.RelativeToView(pageList, (parent, sibling) => {
                return(sibling.Y + sibling.Height + 10);
            })
                                 );
            projectActionList.BackgroundColor = Color.FromHex("F6B11A");
            projectActionList.HeightRequest   = 89;



            template = new DataTemplate(typeof(TextCell));
            template.SetBinding(TextCell.TextProperty, "Text");

            var utilityList = new ListView {
                ItemsSource = new List <Label> {
                    new Label {
                        Text = "Logout"
                    }
                },
                SeparatorColor = Color.Gray,
                ItemTemplate   = template
            };

            utilityList.ItemSelected += (sender, e) => UtilitySelected(sender as ListView);
            Content.AddView(utilityList, 0, -45, 1);
            utilityList.BackgroundColor = Color.White;
        }