コード例 #1
0
        public CategoriesListPage(ProjectViewModel project)
        {
            //Set the view model of the page. Since this is the Projects List page, use that view model.
            var binding = new CategoriesListViewModel((IApplication)Application.Current, project);
            BindingContext = binding;

            ToolbarItems.Add(new ToolbarItem("New Task", "add-task.png", async () => {
                await Navigation.PushAsync(new TaskDetailsPage());
            }));

            InitializeComponent();
        }
コード例 #2
0
        public CategoriesListPage(ProjectViewModel project)
        {
            //Set the view model of the page. Since this is the Projects List page, use that view model.
            var binding = new CategoriesListViewModel((IApplication)Application.Current, project);
            BindingContext = binding;

            var addButton = new ToolbarItem ();
            addButton.Text = "New Task";
            addButton.Icon = "add-task.png";
            addButton.Command = binding.OpenNewTask;

            ToolbarItems.Add(addButton);

            InitializeComponent();
        }