Exemplo n.º 1
0
        public void SaveProject(Project project)
        {
            project.Id = _projects.Any() ?
                _projects.Max (x => x.Id) + 1
                : 1;

            _projects.Add (project);
        }
Exemplo n.º 2
0
        public IssueListPage(Project project)
        {
            NavigationPage.SetHasNavigationBar (this, true);

            _project = project;

            Title = _project.Name;

            _listview = new ListView{
                RowHeight = 80,
                ItemTemplate = new DataTemplate (typeof(IssueItemCell))
            };

            UpdateList ();

            _listview.ItemSelected += (sender, e) => {
                var issue = (Issue) e.SelectedItem;

                var issuePage = new IssuePage(issue.Key);
                issuePage.BindingContext = issue;

                Navigation.PushAsync (issuePage);
            };

            Content = new StackLayout {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = { _listview }
            };

            if (Device.OS == TargetPlatform.iOS) {
                var addMenu = new ToolbarItem("+", null, () => {
                    var issue = new Issue();
                    issue.Project = project;

                    var issuePage = new IssuePage("New Issue");
                    issuePage.BindingContext = issue;

                    Navigation.PushAsync (issuePage);
                }, 0, 0);

                ToolbarItems.Add(addMenu);
            }
        }
Exemplo n.º 3
0
        public App()
        {
            // The root page of your application
            var navigation = new NavigationPage(new ProjectListPage());
            navigation.BarBackgroundColor = Color.FromRgb (10, 65, 110);
            navigation.BarTextColor = Color.White;

            MainPage = navigation;

            var projectA = new Project { Name = "Death Star", Key = "DS" };
            var projectB = new Project { Name = "Light Saber", Key = "LS" };
            var projectC = new Project { Name = "Millenium Falcon", Key = "MF" };

            _db.SaveProject (projectA);
            _db.SaveProject (projectB);
            _db.SaveProject (projectC);

            _db.SaveIssue (new Issue{ Summary = "Relocate expose vent far away from core reactor", Project = projectA });
            _db.SaveIssue (new Issue{ Summary = "Light saber is too large for Yoda", Project = projectB });
            _db.SaveIssue (new Issue{ Summary = "Add more secret compartments for more smuggling", Project = projectC });
        }
Exemplo n.º 4
0
 public IEnumerable<Issue> GetIssues(Project project)
 {
     return App.Database.GetIssues(project.Id);
 }